From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752613AbdFOQik (ORCPT ); Thu, 15 Jun 2017 12:38:40 -0400 Received: from casper.infradead.org ([85.118.1.10]:33986 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbdFOQii (ORCPT ); Thu, 15 Jun 2017 12:38:38 -0400 Date: Thu, 15 Jun 2017 17:38:32 +0100 (BST) From: James Simmons To: Joe Perches cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch In-Reply-To: <1497464706.18751.62.camel@perches.com> Message-ID: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-7-git-send-email-jsimmons@infradead.org> <1497464706.18751.62.camel@perches.com> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1985284609-814246749-1497544712=:11322" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170615_173832_555287_E332DD7B X-CRM114-Status: GOOD ( 17.43 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1985284609-814246749-1497544712=:11322 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT > 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 . Do you mind if I submit a separate patch for this? It would be nice to land the current cleanups as is. Looking at the code I see where more simplication along this line can be done. I submitted a patch for our test harness: https://review.whamcloud.com/#/c/27664 In the near future it will be pushed here. > 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; > } > > --1985284609-814246749-1497544712=:11322--