netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Mark buffer used for debug printks with __maybe_unused
@ 2008-02-20 14:02 Pavel Emelyanov
  2008-02-20 15:29 ` Joe Perches
  0 siblings, 1 reply; 12+ messages in thread
From: Pavel Emelyanov @ 2008-02-20 14:02 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux Netdev List

There are tree places, which declare the char buf[...] on the stack
to push it later into dprintk(). Since the dprintk sometimes (if the 
CONFIG_SYSCTL=n) becomes an empty do { } while (0) stub, these buffers
cause gcc to produce appropriate warnings.

Mark them as __maybe_unused.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 1d3e5fc..303f105 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -175,7 +175,7 @@ static int svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
 	size_t		base = xdr->page_base;
 	unsigned int	pglen = xdr->page_len;
 	unsigned int	flags = MSG_MORE;
-	char		buf[RPC_MAX_ADDRBUFLEN];
+	char		buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
 
 	slen = xdr->len;
 
@@ -716,7 +716,7 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt)
 	struct socket	*newsock;
 	struct svc_sock	*newsvsk;
 	int		err, slen;
-	char		buf[RPC_MAX_ADDRBUFLEN];
+	char		buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
 
 	dprintk("svc: tcp_accept %p sock %p\n", svsk, sock);
 	if (!sock)
@@ -1206,7 +1206,7 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv,
 	struct socket	*sock;
 	int		error;
 	int		type;
-	char		buf[RPC_MAX_ADDRBUFLEN];
+	char		buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
 	struct sockaddr_storage addr;
 	struct sockaddr *newsin = (struct sockaddr *)&addr;
 	int		newlen;

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

end of thread, other threads:[~2008-02-20 17:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 14:02 [PATCH] SUNRPC: Mark buffer used for debug printks with __maybe_unused Pavel Emelyanov
2008-02-20 15:29 ` Joe Perches
2008-02-20 15:31   ` Joe Perches
2008-02-20 15:35     ` Patrick McHardy
2008-02-20 16:27       ` Pavel Emelyanov
2008-02-20 17:00         ` Trond Myklebust
2008-02-20 16:36       ` Joe Perches
2008-02-20 17:02         ` Trond Myklebust
2008-02-20 17:23           ` Joe Perches
2008-02-20 17:41             ` Trond Myklebust
2008-02-20 15:36   ` Pavel Emelyanov
2008-02-20 15:56     ` Joe Perches

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