aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-02-21 02:57:45 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-21 18:42:29 -0500
commit5216a8e70e25b01cbd2915cd0442fb96deb2c262 (patch)
treef372bd3cb3fc2f4a2d3e4ad303e6c4d3f8f48865 /net/sunrpc
parent90dc7d2796edf94a9eaa838321a9734c8513e717 (diff)
Wrap buffers used for rpc debug printks into RPC_IFDEBUG
Sorry for the noise, but here's the v3 of this compilation fix :) There are some 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. Wrap these buffers with RPC_IFDEBUG macro, as Trond proposed, to compile them out when not needed. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/svcsock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 1d3e5fcc2cc..c475977de05 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)
175 size_t base = xdr->page_base; 175 size_t base = xdr->page_base;
176 unsigned int pglen = xdr->page_len; 176 unsigned int pglen = xdr->page_len;
177 unsigned int flags = MSG_MORE; 177 unsigned int flags = MSG_MORE;
178 char buf[RPC_MAX_ADDRBUFLEN]; 178 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
179 179
180 slen = xdr->len; 180 slen = xdr->len;
181 181
@@ -716,7 +716,7 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt)
716 struct socket *newsock; 716 struct socket *newsock;
717 struct svc_sock *newsvsk; 717 struct svc_sock *newsvsk;
718 int err, slen; 718 int err, slen;
719 char buf[RPC_MAX_ADDRBUFLEN]; 719 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
720 720
721 dprintk("svc: tcp_accept %p sock %p\n", svsk, sock); 721 dprintk("svc: tcp_accept %p sock %p\n", svsk, sock);
722 if (!sock) 722 if (!sock)
@@ -1206,10 +1206,10 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv,
1206 struct socket *sock; 1206 struct socket *sock;
1207 int error; 1207 int error;
1208 int type; 1208 int type;
1209 char buf[RPC_MAX_ADDRBUFLEN];
1210 struct sockaddr_storage addr; 1209 struct sockaddr_storage addr;
1211 struct sockaddr *newsin = (struct sockaddr *)&addr; 1210 struct sockaddr *newsin = (struct sockaddr *)&addr;
1212 int newlen; 1211 int newlen;
1212 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
1213 1213
1214 dprintk("svc: svc_create_socket(%s, %d, %s)\n", 1214 dprintk("svc: svc_create_socket(%s, %d, %s)\n",
1215 serv->sv_program->pg_name, protocol, 1215 serv->sv_program->pg_name, protocol,