Home
last modified time | relevance | path

Searched hist:"9863 bc49" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/media/i2c/
H A Dir-kbd-i2c.c9863bc49 Fri Mar 23 06:13:06 CDT 2018 Mauro Carvalho Chehab <mchehab@s-opensource.com> media: ir-kbd-i2c: change the if logic to avoid a warning

While the code is correct, it produces this warning:
drivers/media/i2c/ir-kbd-i2c.c:593 zilog_ir_format() error: buffer overflow 'code_block->codes' 61 <= 173

As static analyzers may be tricked by arithmetic expressions on
comparisions. So, change the order, in order to shut up this
false-positive warning.

That also makes easier for humans to understand that it won't
be trying to go past buffer size.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
9863bc49 Fri Mar 23 06:13:06 CDT 2018 Mauro Carvalho Chehab <mchehab@s-opensource.com> media: ir-kbd-i2c: change the if logic to avoid a warning

While the code is correct, it produces this warning:
drivers/media/i2c/ir-kbd-i2c.c:593 zilog_ir_format() error: buffer overflow 'code_block->codes' 61 <= 173

As static analyzers may be tricked by arithmetic expressions on
comparisions. So, change the order, in order to shut up this
false-positive warning.

That also makes easier for humans to understand that it won't
be trying to go past buffer size.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>