From 30dfe2c05037fbc021121c037872c09956938c2f Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 18 Nov 2010 11:49:25 -0800 Subject: [PATCH] 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 --- drivers/atm/fore200e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index c8fc69c85a0..c0976195935 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -92,7 +92,7 @@ #define FORE200E_INDEX(virt_addr, type, index) (&((type *)(virt_addr))[ index ]) -#define FORE200E_NEXT_ENTRY(index, modulo) (index = ++(index) % (modulo)) +#define FORE200E_NEXT_ENTRY(index, modulo) (index = ((index) + 1) % (modulo)) #if 1 #define ASSERT(expr) if (!(expr)) { \ -- 2.39.3