From: Arnd Bergmann Date: Wed, 6 Dec 2017 21:02:37 +0000 (+0100) Subject: watchdog: hpwdt: fix unused variable warning X-Git-Tag: v5.15~9443^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aeebc6ba88ba3758ad95467ff6191fabf2074c13;p=platform%2Fkernel%2Flinux-starfive.git watchdog: hpwdt: fix unused variable warning The new hpwdt_my_nmi() function is used conditionally, which produces a harmless warning in some configurations: drivers/watchdog/hpwdt.c:478:12: error: 'hpwdt_my_nmi' defined but not used [-Werror=unused-function] This moves it inside of the #ifdef that protects its caller, to silence the warning. Fixes: 621174a92851 ("watchdog: hpwdt: Check source of NMI") Signed-off-by: Arnd Bergmann Reviewed-by: Jerry Hoemann Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index e616583..f1f00df 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -475,12 +475,12 @@ static int hpwdt_time_left(void) return TICKS_TO_SECS(ioread16(hpwdt_timer_reg)); } +#ifdef CONFIG_HPWDT_NMI_DECODING static int hpwdt_my_nmi(void) { return ioread8(hpwdt_nmistat) & 0x6; } -#ifdef CONFIG_HPWDT_NMI_DECODING /* * NMI Handler */