public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Commit 7032a3dd9 (svcrpc: demote some printks to a dprintk) adds warnings
@ 2013-01-08 12:13 Russell King
  2013-01-08 21:28 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2013-01-08 12:13 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs, linux-kernel

Bruce,

Your commit below causes a new build warning in the kernel:

net/sunrpc/svc.c: In function 'svc_printk':
net/sunrpc/svc.c:1050:7: warning: unused variable 'buf'

which affects all ARM builds; it is the only warning in a lot of cases.
Please can you resolve this new warning using whatever method you feel
is most appropriate, thanks.

commit 7032a3dd923f434132643321ad5faad128611f9e
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Tue Oct 9 18:33:38 2012 -0400

    svcrpc: demote some printks to a dprintk
    
    In general I'd rather random bad behavior on the network won't trigger a
    printk.
    
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 3ee7461..be301e1 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1035,7 +1035,7 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net)
 }
 
 /*
- * Printk the given error with the address of the client that caused it.
+ * dprintk the given error with the address of the client that caused it.
  */
 static __printf(2, 3)
 void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
@@ -1049,8 +1049,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
        vaf.fmt = fmt;
        vaf.va = &args;
 
-       net_warn_ratelimited("svc: %s: %pV",
-                            svc_print_addr(rqstp, buf, sizeof(buf)), &vaf);
+       dprintk("svc: %s: %pV", svc_print_addr(rqstp, buf, sizeof(buf)), &vaf);
 
        va_end(args);
 }

-- 
Russell King

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

* Re: Commit 7032a3dd9 (svcrpc: demote some printks to a dprintk) adds warnings
  2013-01-08 12:13 Commit 7032a3dd9 (svcrpc: demote some printks to a dprintk) adds warnings Russell King
@ 2013-01-08 21:28 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2013-01-08 21:28 UTC (permalink / raw)
  To: Russell King; +Cc: J. Bruce Fields, linux-nfs, linux-kernel

On Tue, Jan 08, 2013 at 12:13:00PM +0000, Russell King wrote:
> Bruce,
> 
> Your commit below causes a new build warning in the kernel:
> 
> net/sunrpc/svc.c: In function 'svc_printk':
> net/sunrpc/svc.c:1050:7: warning: unused variable 'buf'
> 
> which affects all ARM builds; it is the only warning in a lot of cases.
> Please can you resolve this new warning using whatever method you feel
> is most appropriate, thanks.

Bah, these "unused variable" warnings for buffers unused in the
!RPC_DEBUG case keep popping up.

I guess I'll commit the following for 3.9.

--b.

commit 31e815406973ef86e2e42a36086d65afb8f4e396
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Tue Jan 8 16:22:15 2013 -0500

    svcrpc: silence "unused variable" warning in !RPC_DEBUG case
    
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index dbf12ac..b9ba2a8 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1042,6 +1042,7 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net)
 /*
  * dprintk the given error with the address of the client that caused it.
  */
+#ifdef RPC_DEBUG
 static __printf(2, 3)
 void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
 {
@@ -1058,6 +1059,9 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
 
 	va_end(args);
 }
+#else
+static __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) {}
+#endif
 
 /*
  * Common routine for processing the RPC request.

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

end of thread, other threads:[~2013-01-08 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08 12:13 Commit 7032a3dd9 (svcrpc: demote some printks to a dprintk) adds warnings Russell King
2013-01-08 21:28 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox