* [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
[not found] <1359123276-15833-1-git-send-email-arnd@arndb.de>
@ 2013-01-25 14:14 ` Arnd Bergmann
[not found] ` <1359153858-31992-1-git-send-email-arnd@arndb.de>
1 sibling, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2013-01-25 14:14 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-kernel, Arnd Bergmann, J. Bruce Fields, Trond Myklebust,
linux-nfs, netdev
When RPC_DEBUG is unset, the dprintk() macro does nothing,
causing the 'buf' variable in svc_printk to become unused.
Marking it as __maybe_unused avoids a harmless gcc warning.
Without this patch, building at91_dt_defconfig results in:
net/sunrpc/svc.c: In function 'svc_printk':
net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "J. Bruce Fields" <bfields@redhat.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Cc: netdev@vger.kernel.org
---
net/sunrpc/svc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index dbf12ac..b1f5223 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
- char buf[RPC_MAX_ADDRBUFLEN];
+ char buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
va_start(args, fmt);
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
[not found] ` <1359153858-31992-1-git-send-email-arnd@arndb.de>
@ 2013-01-25 22:44 ` Arnd Bergmann
2013-01-25 23:04 ` Myklebust, Trond
0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2013-01-25 22:44 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-kernel, Arnd Bergmann, J. Bruce Fields, Trond Myklebust,
linux-nfs, netdev
When RPC_DEBUG is unset, the dprintk() macro does nothing,
causing the 'buf' variable in svc_printk to become unused.
Marking it as __maybe_unused avoids a harmless gcc warning.
Without this patch, building at91_dt_defconfig results in:
net/sunrpc/svc.c: In function 'svc_printk':
net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "J. Bruce Fields" <bfields@redhat.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Cc: netdev@vger.kernel.org
---
net/sunrpc/svc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index dbf12ac..b1f5223 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
- char buf[RPC_MAX_ADDRBUFLEN];
+ char buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
va_start(args, fmt);
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
2013-01-25 22:44 ` Arnd Bergmann
@ 2013-01-25 23:04 ` Myklebust, Trond
2013-01-25 23:45 ` Arnd Bergmann
0 siblings, 1 reply; 7+ messages in thread
From: Myklebust, Trond @ 2013-01-25 23:04 UTC (permalink / raw)
To: Arnd Bergmann, linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, J. Bruce Fields,
linux-nfs@vger.kernel.org, netdev@vger.kernel.org
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Friday, January 25, 2013 5:44 PM
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org; Arnd Bergmann; J. Bruce Fields;
> Myklebust, Trond; linux-nfs@vger.kernel.org; netdev@vger.kernel.org
> Subject: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
>
> When RPC_DEBUG is unset, the dprintk() macro does nothing, causing the
> 'buf' variable in svc_printk to become unused.
> Marking it as __maybe_unused avoids a harmless gcc warning.
>
> Without this patch, building at91_dt_defconfig results in:
>
> net/sunrpc/svc.c: In function 'svc_printk':
> net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: "J. Bruce Fields" <bfields@redhat.com>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: linux-nfs@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
> net/sunrpc/svc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index dbf12ac..b1f5223
> 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char
> *fmt, ...) {
> struct va_format vaf;
> va_list args;
> - char buf[RPC_MAX_ADDRBUFLEN];
> + char buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
>
> va_start(args, fmt);
Alternatively, just declare it using the RPC_IFDEBUG() macro.
Cheers
Trond
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
2013-01-25 23:04 ` Myklebust, Trond
@ 2013-01-25 23:45 ` Arnd Bergmann
2013-01-26 11:03 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2013-01-25 23:45 UTC (permalink / raw)
To: Myklebust, Trond
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, J. Bruce Fields,
linux-nfs@vger.kernel.org, netdev@vger.kernel.org
On Friday 25 January 2013, Myklebust, Trond wrote:
> > -----Original Message-----
> > From: Arnd Bergmann [mailto:arnd@arndb.de]
> > Marking it as __maybe_unused avoids a harmless gcc warning.
>
> Alternatively, just declare it using the RPC_IFDEBUG() macro.
Right, makes sense: that's more consistent with other functions
doing the same thing. Thanks for taking a look.
Arnd
8<----
>From 3b2baeac061bd60dbf14bb61bcc03cbd64c85ac4 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 26 Nov 2012 22:46:26 +0000
Subject: [PATCH] sunrpc: don't warn for unused variable 'buf'
When RPC_DEBUG is unset, the dprintk() macro does nothing,
causing the 'buf' variable in svc_printk to become unused.
Enclosing it in RPC_IFDEBUG avoids a harmless gcc warning.
Without this patch, building at91_dt_defconfig results in:
net/sunrpc/svc.c: In function 'svc_printk':
net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "J. Bruce Fields" <bfields@redhat.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Cc: netdev@vger.kernel.org
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index dbf12ac..9485e66 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
- char buf[RPC_MAX_ADDRBUFLEN];
+ RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
va_start(args, fmt);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
2013-01-25 23:45 ` Arnd Bergmann
@ 2013-01-26 11:03 ` Russell King - ARM Linux
2013-01-26 13:34 ` Arnd Bergmann
0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2013-01-26 11:03 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Myklebust, Trond, netdev@vger.kernel.org,
linux-nfs@vger.kernel.org, J. Bruce Fields,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Fri, Jan 25, 2013 at 11:45:25PM +0000, Arnd Bergmann wrote:
> On Friday 25 January 2013, Myklebust, Trond wrote:
> > > -----Original Message-----
> > > From: Arnd Bergmann [mailto:arnd@arndb.de]
> > > Marking it as __maybe_unused avoids a harmless gcc warning.
> >
> > Alternatively, just declare it using the RPC_IFDEBUG() macro.
>
> Right, makes sense: that's more consistent with other functions
> doing the same thing. Thanks for taking a look.
NAK.
There is already a fix queued up as a result of a previous report I
sent, but for some reason (which I didn't question) it was decided
not to queue it for -rc.
See Bruce's reply on lkml: 20130108212816.GA24572@fieldses.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
2013-01-26 11:03 ` Russell King - ARM Linux
@ 2013-01-26 13:34 ` Arnd Bergmann
2013-01-28 23:18 ` J. Bruce Fields
0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2013-01-26 13:34 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Myklebust, Trond, netdev@vger.kernel.org,
linux-nfs@vger.kernel.org, J. Bruce Fields,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Saturday 26 January 2013, Russell King - ARM Linux wrote:
> On Fri, Jan 25, 2013 at 11:45:25PM +0000, Arnd Bergmann wrote:
> > On Friday 25 January 2013, Myklebust, Trond wrote:
> > > > -----Original Message-----
> > > > From: Arnd Bergmann [mailto:arnd@arndb.de]
> > > > Marking it as __maybe_unused avoids a harmless gcc warning.
> > >
> > > Alternatively, just declare it using the RPC_IFDEBUG() macro.
> >
> > Right, makes sense: that's more consistent with other functions
> > doing the same thing. Thanks for taking a look.
>
> NAK.
>
> There is already a fix queued up as a result of a previous report I
> sent, but for some reason (which I didn't question) it was decided
> not to queue it for -rc.
>
> See Bruce's reply on lkml: 20130108212816.GA24572@fieldses.org
Ok, makes sense. Then again, if that fix is queued for 3.9, maybe
it still makes sense to take the simpler fix into 3.8, and remove
it in 3.9 along with the other instances of RPC_IFDEBUG.
Arnd
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
2013-01-26 13:34 ` Arnd Bergmann
@ 2013-01-28 23:18 ` J. Bruce Fields
0 siblings, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2013-01-28 23:18 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Russell King - ARM Linux, Myklebust, Trond,
netdev@vger.kernel.org, linux-nfs@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Sat, Jan 26, 2013 at 01:34:56PM +0000, Arnd Bergmann wrote:
> On Saturday 26 January 2013, Russell King - ARM Linux wrote:
> > On Fri, Jan 25, 2013 at 11:45:25PM +0000, Arnd Bergmann wrote:
> > > On Friday 25 January 2013, Myklebust, Trond wrote:
> > > > > -----Original Message-----
> > > > > From: Arnd Bergmann [mailto:arnd@arndb.de]
> > > > > Marking it as __maybe_unused avoids a harmless gcc warning.
> > > >
> > > > Alternatively, just declare it using the RPC_IFDEBUG() macro.
> > >
> > > Right, makes sense: that's more consistent with other functions
> > > doing the same thing. Thanks for taking a look.
> >
> > NAK.
> >
> > There is already a fix queued up as a result of a previous report I
> > sent, but for some reason (which I didn't question) it was decided
> > not to queue it for -rc.
> >
> > See Bruce's reply on lkml: 20130108212816.GA24572@fieldses.org
Apologies, I've seen so many "stop sending me post-rc1 patches that
don't fix serious crashes!" flames.
I guess obviousl compile fixes should be an exception--if nothing else
it'd save a lot of duplicated work as this is something like the 3rd
patch I've seen for this.
--b.
>
> Ok, makes sense. Then again, if that fix is queued for 3.9, maybe
> it still makes sense to take the simpler fix into 3.8, and remove
> it in 3.9 along with the other instances of RPC_IFDEBUG.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-01-28 23:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1359123276-15833-1-git-send-email-arnd@arndb.de>
2013-01-25 14:14 ` [PATCH 15/19] sunrpc: don't warn for unused variable 'buf' Arnd Bergmann
[not found] ` <1359153858-31992-1-git-send-email-arnd@arndb.de>
2013-01-25 22:44 ` Arnd Bergmann
2013-01-25 23:04 ` Myklebust, Trond
2013-01-25 23:45 ` Arnd Bergmann
2013-01-26 11:03 ` Russell King - ARM Linux
2013-01-26 13:34 ` Arnd Bergmann
2013-01-28 23:18 ` 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;
as well as URLs for NNTP newsgroup(s).