Skip to content

Commit

Permalink
net/core/sock.c: quiet sparse noise
Browse files Browse the repository at this point in the history
In sock_getsockopt the symbol 'lv' is declared as an
unsigned int type, probably due to sizeof returning a
size_t which is really an unsigned int.

This produces a sparse warning for SO_PEERNAME due to
the sock->ops->getname() call:

warning: incorrect type in argument 3 (different signedness)
   expected int *sockaddr_len
   got unsigned int *<noident>

Quiet the warning by changing the type of 'lv' to an int.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
H Hartley Sweeten authored and David S. Miller committed Jan 15, 2010
1 parent 9a58a80 commit 4d0392b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
struct timeval tm;
} v;

unsigned int lv = sizeof(int);
int lv = sizeof(int);
int len;

if (get_user(len, optlen))
Expand Down

0 comments on commit 4d0392b

Please sign in to comment.