From: Pavel Emelyanov <xemul@openvz.org>
To: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH] SUNRPC: Mark buffer used for debug printks with __maybe_unused
Date: Wed, 20 Feb 2008 17:02:43 +0300 [thread overview]
Message-ID: <47BC3303.2040101@openvz.org> (raw)
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;
next reply other threads:[~2008-02-20 14:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-20 14:02 Pavel Emelyanov [this message]
2008-02-20 15:29 ` [PATCH] SUNRPC: Mark buffer used for debug printks with __maybe_unused 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47BC3303.2040101@openvz.org \
--to=xemul@openvz.org \
--cc=bfields@citi.umich.edu \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.