Skip to content

Commit

Permalink
atm: fore200e: Fix build warning.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Nov 18, 2010
1 parent 57e1ab6 commit 30dfe2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/atm/fore200e.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) { \
Expand Down

0 comments on commit 30dfe2c

Please sign in to comment.