Skip to content

Commit

Permalink
[PATCH] Signedness issue in drivers/net/3c515.c
Browse files Browse the repository at this point in the history
while playing with gcc 4.1 -Wextra warnings, I came across this one:

drivers/net/3c515.c:1027: warning: comparison of unsigned expression >= 0 is always true

Since i is unsigned the >= 0 check in the for loop is always true,
so we might spin there forever unless the if condition triggers.
Since i is only used in this loop, this patch changes it to
an integer.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Eric Sesterhenn authored and Jeff Garzik committed Aug 24, 2006
1 parent a76b044 commit cb95818
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/3c515.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,8 @@ static int corkscrew_start_xmit(struct sk_buff *skb,
/* Calculate the next Tx descriptor entry. */
int entry = vp->cur_tx % TX_RING_SIZE;
struct boom_tx_desc *prev_entry;
unsigned long flags, i;
unsigned long flags;
int i;

if (vp->tx_full) /* No room to transmit with */
return 1;
Expand Down

0 comments on commit cb95818

Please sign in to comment.