Skip to content

Commit 30dfe2c

Browse files
committed
atm: fore200e: Fix build warning.
GCC (rightfully) complains that: drivers/atm/fore200e.c:614:5: warning: operation on 'cmdq->head' may be undefined This is due to the FORE200E_NEXT_ENTRY macro, which essentially evaluates to: i = ++i % m Make it what's explicitly intended here which is: i = (i + 1) % m and the warning goes away. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 57e1ab6 commit 30dfe2c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/atm/fore200e.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292

9393
#define FORE200E_INDEX(virt_addr, type, index) (&((type *)(virt_addr))[ index ])
9494

95-
#define FORE200E_NEXT_ENTRY(index, modulo) (index = ++(index) % (modulo))
95+
#define FORE200E_NEXT_ENTRY(index, modulo) (index = ((index) + 1) % (modulo))
9696

9797
#if 1
9898
#define ASSERT(expr) if (!(expr)) { \

0 commit comments

Comments
 (0)