driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] hp100: remove set but not used variable val
       [not found] <20191105133554.6C01F9A06CB85816F399@huawei.com>
@ 2019-11-05 14:36 ` Chen Wandun
  2019-11-05 14:43   ` Dan Carpenter
  2019-11-05 15:50   ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Chen Wandun @ 2019-11-05 14:36 UTC (permalink / raw)
  To: linux-kernel, devel, perex, gregkh, kstewart, allison, tglx, joe
  Cc: chenwandun

From: Chenwandun <chenwandun@huawei.com>

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

drivers/staging/hp/hp100.c: In function hp100_start_xmit:
drivers/staging/hp/hp100.c:1629:10: warning: variable val set but not used [-Wunused-but-set-variable]

Signed-off-by: Chenwandun <chenwandun@huawei.com>
---
 drivers/staging/hp/hp100.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
index 6ec78f5..6fc7733 100644
--- a/drivers/staging/hp/hp100.c
+++ b/drivers/staging/hp/hp100.c
@@ -1626,7 +1626,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
 	unsigned long flags;
 	int i, ok_flag;
 	int ioaddr = dev->base_addr;
+#ifdef HP100_DEBUG_TX
 	u_short val;
+#endif
 	struct hp100_private *lp = netdev_priv(dev);
 
 #ifdef HP100_DEBUG_B
@@ -1695,7 +1697,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
 
 	spin_lock_irqsave(&lp->lock, flags);
 	hp100_ints_off();
+#ifdef HP100_DEBUG_TX
 	val = hp100_inw(IRQ_STATUS);
+#endif
 	/* Ack / clear the interrupt TX_COMPLETE interrupt - this interrupt is set
 	 * when the current packet being transmitted on the wire is completed. */
 	hp100_outw(HP100_TX_COMPLETE, IRQ_STATUS);
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2] hp100: remove set but not used variable val
  2019-11-05 14:36 ` [PATCH v2] hp100: remove set but not used variable val Chen Wandun
@ 2019-11-05 14:43   ` Dan Carpenter
  2019-11-05 15:50   ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-11-05 14:43 UTC (permalink / raw)
  To: Chen Wandun
  Cc: devel, kstewart, gregkh, linux-kernel, perex, joe, tglx, allison

On Tue, Nov 05, 2019 at 10:36:59PM +0800, Chen Wandun wrote:
> From: Chenwandun <chenwandun@huawei.com>
> 
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/hp/hp100.c: In function hp100_start_xmit:
> drivers/staging/hp/hp100.c:1629:10: warning: variable val set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chenwandun <chenwandun@huawei.com>
> ---

You should explain why you are sending a v2 under the --- cut off line.

The v1 was the correct patch, but this driver is going to be deleted
soon so I don't think we are accepting this sort of cleanup.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2] hp100: remove set but not used variable val
  2019-11-05 14:36 ` [PATCH v2] hp100: remove set but not used variable val Chen Wandun
  2019-11-05 14:43   ` Dan Carpenter
@ 2019-11-05 15:50   ` Greg KH
  2019-11-05 17:13     ` Joe Perches
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2019-11-05 15:50 UTC (permalink / raw)
  To: Chen Wandun; +Cc: devel, kstewart, linux-kernel, perex, joe, tglx, allison

On Tue, Nov 05, 2019 at 10:36:59PM +0800, Chen Wandun wrote:
> From: Chenwandun <chenwandun@huawei.com>
> 
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/hp/hp100.c: In function hp100_start_xmit:
> drivers/staging/hp/hp100.c:1629:10: warning: variable val set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chenwandun <chenwandun@huawei.com>

I need a "full" name here, like the one on your email "From:" line.

> ---
>  drivers/staging/hp/hp100.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
> index 6ec78f5..6fc7733 100644
> --- a/drivers/staging/hp/hp100.c
> +++ b/drivers/staging/hp/hp100.c
> @@ -1626,7 +1626,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
>  	unsigned long flags;
>  	int i, ok_flag;
>  	int ioaddr = dev->base_addr;
> +#ifdef HP100_DEBUG_TX
>  	u_short val;
> +#endif

#ifdefs are not ok in .c code, sorry.

>  	struct hp100_private *lp = netdev_priv(dev);
>  
>  #ifdef HP100_DEBUG_B
> @@ -1695,7 +1697,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
>  
>  	spin_lock_irqsave(&lp->lock, flags);
>  	hp100_ints_off();
> +#ifdef HP100_DEBUG_TX
>  	val = hp100_inw(IRQ_STATUS);

Are you sure that this doesn't actually change the hardware in some way?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2] hp100: remove set but not used variable val
  2019-11-05 15:50   ` Greg KH
@ 2019-11-05 17:13     ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2019-11-05 17:13 UTC (permalink / raw)
  To: Greg KH, Chen Wandun; +Cc: devel, kstewart, linux-kernel, perex, tglx, allison

On Tue, 2019-11-05 at 16:50 +0100, Greg KH wrote:
> On Tue, Nov 05, 2019 at 10:36:59PM +0800, Chen Wandun wrote:
> > From: Chenwandun <chenwandun@huawei.com>
> > 
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/staging/hp/hp100.c: In function hp100_start_xmit:
> > drivers/staging/hp/hp100.c:1629:10: warning: variable val set but not used [-Wunused-but-set-variable]
> > 
> > Signed-off-by: Chenwandun <chenwandun@huawei.com>
> 
> I need a "full" name here, like the one on your email "From:" line.

You also need the submitter to run checkpatch on the patch
and not just the file.

WARNING: drivers/staging/hp/hp100.c is marked as 'obsolete' in the MAINTAINERS hierarchy.  No unnecessary modifications please.

WARNING: drivers/staging/hp/hp100.c is marked as 'obsolete' in the MAINTAINERS hierarchy.  No unnecessary modifications please.
total: 0 errors, 2 warnings, 0 checks, 18 lines checked

> > diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
[]
> > @@ -1626,7 +1626,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
> >  	unsigned long flags;
> >  	int i, ok_flag;
> >  	int ioaddr = dev->base_addr;
> > +#ifdef HP100_DEBUG_TX
> >  	u_short val;
> > +#endif
> 
> #ifdefs are not ok in .c code, sorry.
> 
> >  	struct hp100_private *lp = netdev_priv(dev);
> >  
> >  #ifdef HP100_DEBUG_B
> > @@ -1695,7 +1697,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
> >  
> >  	spin_lock_irqsave(&lp->lock, flags);
> >  	hp100_ints_off();
> > +#ifdef HP100_DEBUG_TX
> >  	val = hp100_inw(IRQ_STATUS);
> 
> Are you sure that this doesn't actually change the hardware in some way?

If anyone still _has_ the hardware, please let me know.

I have the only VG test equipment I know of in a box
somewhere in my basement and it's yours for the asking
and the postage.

It hasn't been powered on in 25 years, no guarantees...


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2019-11-05 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191105133554.6C01F9A06CB85816F399@huawei.com>
2019-11-05 14:36 ` [PATCH v2] hp100: remove set but not used variable val Chen Wandun
2019-11-05 14:43   ` Dan Carpenter
2019-11-05 15:50   ` Greg KH
2019-11-05 17:13     ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).