]> git.ipfire.org Git - people/arne_f/kernel.git/commit
Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 26 Oct 2016 22:55:02 +0000 (15:55 -0700)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:32 +0000 (10:28 -0500)
commit017d85347f4f0b6f2fc25cab5fbbcc3604be366a
tree3264be606f5eac30bfc3824697084285e169cb39
parent21633c4d20dab18549e5763bc86466cf1083b293
Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning

[ Upstream commit ea4348c8462a20e8b1b6455a7145d2b86f8a49b6 ]

Older versions of gcc warn about the tca8418_irq_handler function
as they can't keep track of the variable assignment inside of the
loop when using the -Wmaybe-unintialized flag:

drivers/input/keyboard/tca8418_keypad.c: In function ‘tca8418_irq_handler’:
drivers/input/keyboard/tca8418_keypad.c:172:9: error: ‘reg’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/input/keyboard/tca8418_keypad.c:165:5: note: ‘reg’ was declared here

This is fixed in gcc-6, but it's possible to rearrange the code
in a way that avoids the warning on older compilers as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/input/keyboard/tca8418_keypad.c