netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* warnings from recent format patch
@ 2008-11-03  0:33 Stephen Hemminger
  2008-11-03  7:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2008-11-03  0:33 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: netdev

Even if you can't run it, please compile and run sparse on your
code.

 CC [M]  net/sunrpc/xprtsock.o
net/sunrpc/xprtsock.c: In function ‘xs_format_ipv4_peer_addresses’:
net/sunrpc/xprtsock.c:287: warning: too many arguments for format

static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt,
					  const char *protocol,
					  const char *netid)
{
	struct sockaddr_in *addr = xs_addr_in(xprt);
	char *buf;

	buf = kzalloc(20, GFP_KERNEL);
	if (buf) {
		snprintf(buf, 20, "pI4", &addr->sin_addr.s_addr);
                                   ^
                                   missing %

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

* Re: warnings from recent format patch
  2008-11-03  0:33 warnings from recent format patch Stephen Hemminger
@ 2008-11-03  7:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-11-03  7:57 UTC (permalink / raw)
  To: shemminger; +Cc: harvey.harrison, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sun, 2 Nov 2008 16:33:11 -0800

> Even if you can't run it, please compile and run sparse on your
> code.
> 
>  CC [M]  net/sunrpc/xprtsock.o
> net/sunrpc/xprtsock.c: In function ‘xs_format_ipv4_peer_addresses’:
> net/sunrpc/xprtsock.c:287: warning: too many arguments for format

Thanks so much for the patch Stephen, that's so much
better than what most people do, which is just whine.

commit e0db4a786bbd73145b4feb45c75d49b6e60fe72c
Author: David S. Miller <davem@davemloft.net>
Date:   Sun Nov 2 23:57:06 2008 -0800

    sunrpc: Fix build warning due to typo in %pI4 format changes.
    
    Noticed by Stephen Hemminger.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index c14d3fd..5cbb404 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -284,7 +284,7 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt,
 
 	buf = kzalloc(20, GFP_KERNEL);
 	if (buf) {
-		snprintf(buf, 20, "pI4", &addr->sin_addr.s_addr);
+		snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr);
 	}
 	xprt->address_strings[RPC_DISPLAY_ADDR] = buf;
 

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

end of thread, other threads:[~2008-11-03  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-03  0:33 warnings from recent format patch Stephen Hemminger
2008-11-03  7:57 ` 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).