From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3174CC38A29 for ; Sat, 18 Apr 2020 18:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19FE221D93 for ; Sat, 18 Apr 2020 18:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728079AbgDRS4E (ORCPT ); Sat, 18 Apr 2020 14:56:04 -0400 Received: from smtprelay0197.hostedemail.com ([216.40.44.197]:59352 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726086AbgDRS4D (ORCPT ); Sat, 18 Apr 2020 14:56:03 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id BBBA618018500; Sat, 18 Apr 2020 18:56:01 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: money21_1707d78e8f515 X-Filterd-Recvd-Size: 3611 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Sat, 18 Apr 2020 18:55:58 +0000 (UTC) Message-ID: <6c796219ea79d87093409f2dd1d3bf8e4a157ed7.camel@perches.com> Subject: Re: [PATCH 6/9] nfsd: fix empty-body warning in nfs4state.c From: Joe Perches To: Chuck Lever , Randy Dunlap Cc: LKML , Linus Torvalds , Andrew Morton , Al Viro , linux-fsdevel@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, Bruce Fields , Linux NFS Mailing List , Johannes Berg , Dan Williams , Vishal Verma , Dave Jiang , linux-nvdimm@lists.01.org, "Martin K. Petersen" , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, Zzy Wysm Date: Sat, 18 Apr 2020 11:53:44 -0700 In-Reply-To: References: <20200418184111.13401-1-rdunlap@infradead.org> <20200418184111.13401-7-rdunlap@infradead.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, 2020-04-18 at 14:45 -0400, Chuck Lever wrote: > > On Apr 18, 2020, at 2:41 PM, Randy Dunlap 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 > > Cc: Linus Torvalds > > Cc: Andrew Morton > > Cc: "J. Bruce Fields" > > Cc: Chuck Lever > > Cc: linux-nfs@vger.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 > > 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 > > #include > > +#include > > #include > > #include > > #include > > @@ -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(); > > new->cl_minorversion = 0; > > gen_callback(new, setclid, rqstp); > > add_to_unconfirmed(new); This empty else seems silly and could likely be better handled by a comment above the first if, something like: /* for now only handle case 1: probable callback update */ if (conf && same_verf(&conf->cl_verifier, &clverifier)) { copy_clid(new, conf); gen_confirm(new, nn); } with no else use.