• Arnd Bergmann's avatar
    Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning · ea4348c8
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    ea4348c8
tca8418_keypad.c 10.6 KB