OSDN Git Service

char: nwbutton: avoid unused variable warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 25 Jan 2016 15:54:25 +0000 (16:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2016 01:39:56 +0000 (17:39 -0800)
commit990162f038400bd229685316beea1155be095125
tree71695cf035b137fe12937beb875936e2c5c1a0fb
parentc74c9318a3a76c3714785bc06147dd207a9d0aa3
char: nwbutton: avoid unused variable warning

When CONFIG_NWBUTTON_REBOOT is disabled, we get a warning about
an unused variable:

drivers/char/nwbutton.c:37:12: warning: 'reboot_count' defined but not used [-Wunused-variable]
 static int reboot_count = NUM_PRESSES_REBOOT; /* Number of presses to reboot */

Using if(IS_ENABLED()) instead of #ifdef around the user makes the
code nicer to read and avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/nwbutton.c