Skip to contentSkip to conversation

chelsio: Fix build warning.

PATCH New David Miller 1 participant 1 message Apr 13, 2010

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 chelsio: Fix build warning.

GCC warns that:

drivers/net/chelsio/sge.c:463:11: warning: operation on 's->port' may be undefined

Better to eliminate the side effects in the calculation and express what was intended here.

---
 drivers/net/chelsio/sge.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/chelsio/sge.c +1 -1
index 475304f..a8ffc1e 100644
@@ -460,7 +460,7 @@ static struct sk_buff *sched_skb(struct sge *sge, struct sk_buff *skb,
 
 again:
 	for (i = 0; i < MAX_NPORTS; i++) {
-		s->port = ++s->port & (MAX_NPORTS - 1);
+		s->port = (s->port + 1) & (MAX_NPORTS - 1);
 		skbq = &s->p[s->port].skbq;
 
 		skb = skb_peek(skbq);
Signature · 1 line
1.7.0.4