From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726AbdFNSZL (ORCPT ); Wed, 14 Jun 2017 14:25:11 -0400 Received: from smtprelay0016.hostedemail.com ([216.40.44.16]:55811 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752126AbdFNSZJ (ORCPT ); Wed, 14 Jun 2017 14:25:09 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3874:4321:5007:7901:7903:10004:10400:10848:11026:11232:11473:11657:11658:11783:11914:12043:12048:12296:12679:12740:12895:13069:13255:13311:13357:13439:13894:14659:14721:21080:21627:30012:30054:30060: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:2,LUA_SUMMARY:none X-HE-Tag: paper67_66e6503db6a1f X-Filterd-Recvd-Size: 2579 Message-ID: <1497464706.18751.62.camel@perches.com> Subject: Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch From: Joe Perches To: James Simmons , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin Cc: Linux Kernel Mailing List , Lustre Development List Date: Wed, 14 Jun 2017 11:25:06 -0700 In-Reply-To: <1497452481-31124-7-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-7-git-send-email-jsimmons@infradead.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > Cleanup all braces that was reported by checkpatch. The only > issue not fixed up is in mdc_lock.c. Removing the braces in > the case of mdc_lock.c will break the build. [] > diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c [] > @@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) > env = cl_env_get(&refcheck); > if (!IS_ERR(env)) { > sbi = f->private; > - if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) > + if (sbi->ll_site->ls_obj_hash->hs_cur_bits > > + 64 - PGC_OBJ_SHIFT) { > pos = ERR_PTR(-EFBIG); > - else { > + } else { > *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, > *pos); > if (*pos == ~0ULL) Sometimes is nicer to rearrange the code with smaller indentation by using early returns and/or goto . Something like: static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) { struct ll_sb_info *sbi; struct lu_env     *env; u16 refcheck; sbi = f->private; env = cl_env_get(&refcheck); if (IS_ERR(env)) return pos; sbi = f->private; if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) { pos = ERR_PTR(-EFBIG); goto out; } *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, *pos); if (*pos == ~0ULL) pos = NULL; out: cl_env_put(env, &refcheck); return pos; }