All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: hpwdt: fix unused variable warning
@ 2017-12-06 21:02 Arnd Bergmann
  2017-12-06 22:53 ` Jerry Hoemann
  2017-12-07  4:36 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-12-06 21:02 UTC (permalink / raw)
  To: Jimmy Vance, Wim Van Sebroeck
  Cc: Arnd Bergmann, Guenter Roeck, Jerry Hoemann, linux-watchdog,
	linux-kernel

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 <arnd@arndb.de>
---
 drivers/watchdog/hpwdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index e61658310381..f1f00dfc0e68 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
  */
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: hpwdt: fix unused variable warning
  2017-12-06 21:02 [PATCH] watchdog: hpwdt: fix unused variable warning Arnd Bergmann
@ 2017-12-06 22:53 ` Jerry Hoemann
  2017-12-07  4:36 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Jerry Hoemann @ 2017-12-06 22:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jimmy Vance, Wim Van Sebroeck, Guenter Roeck, linux-watchdog,
	linux-kernel

On Wed, Dec 06, 2017 at 10:02:37PM +0100, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
> ---
>  drivers/watchdog/hpwdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index e61658310381..f1f00dfc0e68 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
>   */
> -- 
> 2.9.0
> 


Looks fine. Thanks!


Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>


-- 

-----------------------------------------------------------------------------
Jerry Hoemann                  Software Engineer   Hewlett Packard Enterprise
-----------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: hpwdt: fix unused variable warning
  2017-12-06 21:02 [PATCH] watchdog: hpwdt: fix unused variable warning Arnd Bergmann
  2017-12-06 22:53 ` Jerry Hoemann
@ 2017-12-07  4:36 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2017-12-07  4:36 UTC (permalink / raw)
  To: Arnd Bergmann, Jimmy Vance, Wim Van Sebroeck
  Cc: Jerry Hoemann, linux-watchdog, linux-kernel

On 12/06/2017 01:02 PM, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/hpwdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index e61658310381..f1f00dfc0e68 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
>    */
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-07  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 21:02 [PATCH] watchdog: hpwdt: fix unused variable warning Arnd Bergmann
2017-12-06 22:53 ` Jerry Hoemann
2017-12-07  4:36 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.