All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: applicom: remove set but not used variable 'byte_reset_it'
@ 2020-07-21  8:41 Zheng Yongjun
  2020-07-21  8:54 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-07-21  8:41 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Zheng Yongjun

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/char/applicom.c: In function 'ac_register_board':
drivers/char/applicom.c:543: warning:
variable 'byte_reset_it' set but not used [-Wunused-but-set-variable]

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/char/applicom.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 14b2d8034c51..fd0b21607a7f 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -131,8 +131,6 @@ static int dummy;	/* dev_id for request_irq() */
 static int ac_register_board(unsigned long physloc, void __iomem *loc, 
 		      unsigned char boardno)
 {
-	volatile unsigned char byte_reset_it;
-
 	if((readb(loc + CONF_END_TEST)     != 0x00) ||
 	   (readb(loc + CONF_END_TEST + 1) != 0x55) ||
 	   (readb(loc + CONF_END_TEST + 2) != 0xAA) ||
@@ -160,7 +158,6 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
 	apbs[boardno].RamIO = loc;
 	init_waitqueue_head(&apbs[boardno].FlagSleepSend);
 	spin_lock_init(&apbs[boardno].mutex);
-	byte_reset_it = readb(loc + RAM_IT_TO_PC);
 
 	numboards++;
 	return boardno + 1;
-- 
2.17.1


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

* Re: [PATCH] drivers: applicom: remove set but not used variable 'byte_reset_it'
  2020-07-21  8:41 [PATCH] drivers: applicom: remove set but not used variable 'byte_reset_it' Zheng Yongjun
@ 2020-07-21  8:54 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-07-21  8:54 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: arnd, linux-kernel

On Tue, Jul 21, 2020 at 04:41:07PM +0800, Zheng Yongjun wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/char/applicom.c: In function 'ac_register_board':
> drivers/char/applicom.c:543: warning:
> variable 'byte_reset_it' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  drivers/char/applicom.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
> index 14b2d8034c51..fd0b21607a7f 100644
> --- a/drivers/char/applicom.c
> +++ b/drivers/char/applicom.c
> @@ -131,8 +131,6 @@ static int dummy;	/* dev_id for request_irq() */
>  static int ac_register_board(unsigned long physloc, void __iomem *loc, 
>  		      unsigned char boardno)
>  {
> -	volatile unsigned char byte_reset_it;
> -
>  	if((readb(loc + CONF_END_TEST)     != 0x00) ||
>  	   (readb(loc + CONF_END_TEST + 1) != 0x55) ||
>  	   (readb(loc + CONF_END_TEST + 2) != 0xAA) ||
> @@ -160,7 +158,6 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
>  	apbs[boardno].RamIO = loc;
>  	init_waitqueue_head(&apbs[boardno].FlagSleepSend);
>  	spin_lock_init(&apbs[boardno].mutex);
> -	byte_reset_it = readb(loc + RAM_IT_TO_PC);

Are you sure you didn't just break the driver?  Lots of times reading
from hardware is required in order to have previous things work, or even
have other affects.

thanks,

greg k-h

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

end of thread, other threads:[~2020-07-21  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21  8:41 [PATCH] drivers: applicom: remove set but not used variable 'byte_reset_it' Zheng Yongjun
2020-07-21  8:54 ` Greg KH

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.