diff mbox

net/core/sock.c: quiet sparse noise

Message ID 201001141721.45305.hartleys@visionengravers.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Hartley Sweeten Jan. 15, 2010, 12:21 a.m. UTC
net/core/sock.c: quiet sparse noise

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 my changing the type of 'lv' to an int.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David S. Miller <davem@davemloft.net>

---

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Jan. 15, 2010, 9:09 a.m. UTC | #1
From: H Hartley Sweeten <hartleys@visionengravers.com>
Date: Thu, 14 Jan 2010 17:21:45 -0700

> net/core/sock.c: quiet sparse noise
> 
> 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 my changing the type of 'lv' to an int.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Applied to net-next-2.6, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/sock.c b/net/core/sock.c
index e1f6f22..10b1d32 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -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))