[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d2e2f7967804446a825ec0ff61095e6640b5a968.camel@hammerspace.com>
Date: Sat, 18 Apr 2020 22:28:26 +0000
From: Trond Myklebust <trondmy@...merspace.com>
To: "rdunlap@...radead.org" <rdunlap@...radead.org>,
"chuck.lever@...cle.com" <chuck.lever@...cle.com>
CC: "linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"bfields@...ldses.org" <bfields@...ldses.org>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"zzy@...wysm.com" <zzy@...wysm.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"johannes@...solutions.net" <johannes@...solutions.net>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"vishal.l.verma@...el.com" <vishal.l.verma@...el.com>,
"linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"perex@...ex.cz" <perex@...ex.cz>,
"dave.jiang@...el.com" <dave.jiang@...el.com>,
"tiwai@...e.com" <tiwai@...e.com>,
"target-devel@...r.kernel.org" <target-devel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"dan.j.williams@...el.com" <dan.j.williams@...el.com>
Subject: Re: [PATCH 6/9] nfsd: fix empty-body warning in nfs4state.c
On Sat, 2020-04-18 at 14:45 -0400, Chuck Lever wrote:
> > On Apr 18, 2020, at 2:41 PM, Randy Dunlap <rdunlap@...radead.org>
> > wrote:
> >
> > Fix gcc empty-body warning when -Wextra is used:
> >
> > ../fs/nfsd/nfs4state.c:3898:3: warning: suggest braces around empty
> > body in an ‘else’ statement [-Wempty-body]
> >
> > Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> > Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > Cc: "J. Bruce Fields" <bfields@...ldses.org>
> > Cc: Chuck Lever <chuck.lever@...cle.com>
> > Cc: linux-nfs@...r.kernel.org
>
> I have a patch in my queue that addresses this particular warning,
> but your change works for me too.
>
> Acked-by: Chuck Lever <chuck.lever@...cle.com>
>
> Unless Bruce objects.
>
>
> > ---
> > fs/nfsd/nfs4state.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > --- linux-next-20200417.orig/fs/nfsd/nfs4state.c
> > +++ linux-next-20200417/fs/nfsd/nfs4state.c
> > @@ -34,6 +34,7 @@
> >
> > #include <linux/file.h>
> > #include <linux/fs.h>
> > +#include <linux/kernel.h>
> > #include <linux/slab.h>
> > #include <linux/namei.h>
> > #include <linux/swap.h>
> > @@ -3895,7 +3896,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp
> > copy_clid(new, conf);
> > gen_confirm(new, nn);
> > } else /* case 4 (new client) or cases 2, 3 (client reboot): */
> > - ;
> > + do_empty();
Urgh... This is just for documentation purposes anyway, so why not just
turn it all into a comment by moving the 'else' into the comment field?
i.e.
} /* else case 4 (.... */
new->cl_minorversion = 0;
> > gen_callback(new, setclid, rqstp);
> > add_to_unconfirmed(new);
>
> --
> Chuck Lever
>
>
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@...merspace.com
Powered by blists - more mailing lists