소스 검색

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.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 15 년 전
부모
커밋
18d777a5bc
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/net/chelsio/sge.c

+ 1 - 1
drivers/net/chelsio/sge.c

@@ -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);