]> git.baikalelectronics.ru Git - kernel.git/commit
Input: cyapa - remove superfluous type check in cyapa_gen5_read_idac_data()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 2 Mar 2015 17:39:24 +0000 (09:39 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 2 Mar 2015 21:31:33 +0000 (13:31 -0800)
commit1bfd61d1b5a33ad5385be5f75f2ea73baa6bc4bb
treef2984d19c6a33a0c03f751597ece248cdbe68cb5
parent8495af827bec073e26f4741b83adf10606ac5a1c
Input: cyapa - remove superfluous type check in cyapa_gen5_read_idac_data()

drivers/input/mouse/cyapa_gen5.c: In function ‘cyapa_gen5_read_idac_data’:
drivers/input/mouse/cyapa_gen5.c:1876: warning: ‘max_element_cnt’ may be used uninitialized in this function
drivers/input/mouse/cyapa_gen5.c:1873: warning: ‘offset’ may be used uninitialized in this function

If *data_size is non-zero, and idac_data_type contains an unknown type,
max_element_cnt and offset will be uninitialized, and the loop will
process non-existing data.

However, this cannot happen (for now), as there's a test for unknown
types at the top of cyapa_gen5_read_idac_data().

As no "if ... else if ..." is used in other places, remove the
superfluous "if" to silence the compiler warning.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/cyapa_gen5.c