From 25d4affb0c62444354b080c5d8444a8a4b89cd96 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 23 Apr 2018 08:29:09 -0400 Subject: media: flexcop-i2c: get rid of KERN_CONT Coverity complains about werid stuff at the debug logic: CID 113542 (#1 of 1): Out-of-bounds access (ARRAY_VS_SINGLETON)10. callee_ptr_arith: Passing buf to function flexcop_i2c_write4 which uses it as an array. This might corrupt or misinterpret adjacent memory locations. Instead of directly addressing the issue there, let's rework at the logic there. On newer kernels, KERN_CONT does nothing, as the previous message won't wait for a continuation. Also, both flexcop_i2c_read4() and flexcop_i2c_write4(), called by it, will print stuff if (debug &4). So, the way it is is too buggy. There are two kinds of debug stuff there: deb_i2c() and a code hidden under #ifdef DUMP_I2C_MESSAGES, with can't be selected without touching the source code. Also, if both debug & 0x4 and DUMP_I2C_MESSAGES, flexcop_i2c_request() will emit two debug messages per call with different data, with sounds messy. Simplify it by getting rid of DUMP_I2C_MESSAGES and adding a new flag to debug (0x40), and making the debug logic there more consistent. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/b2c2/flexcop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/common/b2c2/flexcop.c') diff --git a/drivers/media/common/b2c2/flexcop.c b/drivers/media/common/b2c2/flexcop.c index 2e0ab55..cbaa61f 100644 --- a/drivers/media/common/b2c2/flexcop.c +++ b/drivers/media/common/b2c2/flexcop.c @@ -42,7 +42,7 @@ int b2c2_flexcop_debug; EXPORT_SYMBOL_GPL(b2c2_flexcop_debug); module_param_named(debug, b2c2_flexcop_debug, int, 0644); MODULE_PARM_DESC(debug, - "set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able))." + "set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg,64=i2cdump (|-able))." DEBSTATUS); #undef DEBSTATUS -- cgit v1.1