Skip to content

Commit

Permalink
[IPV4]: [2/4] signed vs unsigned cleanup in net/ipv4/raw.c
Browse files Browse the repository at this point in the history
This patch gets rid of the following gcc -W warning in net/ipv4/raw.c :

net/ipv4/raw.c:387: warning: comparison of unsigned expression < 0 is always false

Since 'len' is of type size_t it is unsigned and can thus never be <0, and 
since this is obvious from the function declaration just a few lines above 
I think it's ok to remove the pointless check for len<0.


Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jesper Juhl authored and David S. Miller committed Jun 19, 2005
1 parent 5418c69 commit 926d4b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
int err;

err = -EMSGSIZE;
if (len < 0 || len > 0xFFFF)
if (len > 0xFFFF)
goto out;

/*
Expand Down

0 comments on commit 926d4b8

Please sign in to comment.