netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/core/sock.c: quiet sparse noise
@ 2010-01-15  0:21 H Hartley Sweeten
  2010-01-15  9:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2010-01-15  0:21 UTC (permalink / raw)
  To: Linux Kernel, netdev; +Cc: davem

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>

---

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))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-15  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15  0:21 [PATCH] net/core/sock.c: quiet sparse noise H Hartley Sweeten
2010-01-15  9:09 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).