Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1948877ybz; Sat, 18 Apr 2020 11:57:08 -0700 (PDT) X-Google-Smtp-Source: APiQypI5EdQzGKYBuvQi6VG7EUDIMpe6+gJ5579Zb2L4ScMSJXAAvERJQz3hiKrIBNm1MWecbP4L X-Received: by 2002:a05:6402:1d15:: with SMTP id dg21mr1942985edb.13.1587236228422; Sat, 18 Apr 2020 11:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587236228; cv=none; d=google.com; s=arc-20160816; b=EHfn4ZbGmr/I/Lox+JmDGzFqVADs7xXZy05e/Z1J54Ttq2DMLiadq/6nRwiP3pZ1C5 wQo5cRRqjIpCc6KOKknGBEpJ/m+55GknMCqodm9zmZSMrAmgKN3w10a5MJ5eGfV8UIs0 ew8Ug9C4LSFkdeLguVWjisqclpf0ewkIWA9Xj3rrcI1KEJKQfHNJPRBQbp1GIpXbvU0Z sHJxbWRJAZRgMo0oYj00U+aBpSmyqnJA9xs6VKitmb/4xmQhMoHHvI/6SJpRQaHoxvuv bcyTJjJSTph27Yh4rBdCdaiT58lTZCx6dQ966Wg4xPi5PlV5oDJd1ybQ0N4IQoXY5Qsr /1bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=l8FddJspZWyoc60ZPtCoCJ0+EmXOdYnqqCmYf3JmENY=; b=L4SxIF5g1nbupHXU69xLcBUoDbe1/Agq+EH9+/yFWVOlNvtoxz3/AXsK+CAc0BnauW 6uJHWSh4xJoJoqN0BTdVFo+CKXvHYKBKj/xEjgmgrXEDkd8nBAFXXdq5mXj0oSbz7Nnu sVCT1OIKRVwBjJdrpawobMJ/afiGaKqwG0P4x1YbG/XBJVl4FRqLdv9mYME6pmWY9cxD nedaea1UqvOL3o7n/x/DZ+ay6muSH6o5/nvip/57Z+qAiNBYcdBN1+hlEn3SBvSp5vMo cjuXMlQqu6JFPUPxJxmgM9/S8m/FBWu8SIHwK2j4kF8szvy+S370jN/pVgZLzG2WzlHE 6hrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si17586769edl.2.2020.04.18.11.56.45; Sat, 18 Apr 2020 11:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727925AbgDRS4E (ORCPT + 99 others); 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-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:152:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2895:3138:3139:3140:3141:3142:3353:3622:3865:3868:3870:3871:3874:4321:5007:6119:6742:6743:7875:7903:10004:10400:10848:11026:11232:11658:11914:12043:12296:12297:12555:12740:12895:12986:13069:13311:13357:13894:14096:14097:14181:14659:14721:21080:21451:21627:21660:21740:30054:30060:30064:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:14,LUA_SUMMARY:none 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-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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.