Skip to contentSkip to conversation

hp100: remove set but not used variable val

PATCH In review Chen Wandun 4 participants 4 messages Nov 5, 2019 1 message not in the archive Staging

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/1 hp100: remove set but not used variable val

From: Chenwandun <[email protected]>

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]

---
 drivers/staging/hp/hp100.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/hp/hp100.c +4 -0
index 6ec78f5..6fc7733 100644
@@ -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);
Signature · 1 line
2.7.4
#2 lore raw
Quoted 9 lines · Chen Wandun

From: Chenwandun <[email protected]>

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]

---

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

maintainer
#3 lore raw
In reply to Chen Wandun
Quoted 8 lines · Chen Wandun

From: Chenwandun <[email protected]>

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]

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

Quoted 9 lines
---
 drivers/staging/hp/hp100.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/hp/hp100.c +0 -0
index 6ec78f5..6fc7733 100644

drivers/staging/hp/hp100.c static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, · line 1631

Quoted 6 lines
drivers/staging/hp/hp100.c +2 -0
@@ -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.

drivers/staging/hp/hp100.c static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, · line 1701

Quoted 9 lines
drivers/staging/hp/hp100.c +1 -0
 	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

#4 lore raw
Quoted 11 lines · Greg KH
Quoted 8 lines · Chen Wandun

From: Chenwandun <[email protected]>

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]

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

Quoted 1 line

drivers/staging/hp/hp100.c

Quoted 1 line
drivers/staging/hp/hp100.c +0 -0

[]

Quoted 15 lines

drivers/staging/hp/hp100.c static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, · line 1631

Quoted 7 lines
drivers/staging/hp/hp100.c +2 -0
@@ -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.

Quoted 5 lines
drivers/staging/hp/hp100.c +0 -0
 	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,
 
Quoted 6 lines

drivers/staging/hp/hp100.c static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, · line 1701

Quoted 4 lines
drivers/staging/hp/hp100.c +1 -0
 	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...