public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: James Simmons <jsimmons@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>
Subject: Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch
Date: Thu, 15 Jun 2017 09:58:46 -0700	[thread overview]
Message-ID: <1497545926.14396.11.camel@perches.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1706151708230.11322@casper.infradead.org>

On Thu, 2017-06-15 at 17:38 +0100, James Simmons wrote:
> > 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 <labels>.
> 
> Do you mind if I submit a separate patch for this?
> It would be nice to land the current cleanups as is.

Of course not.

> Looking at the code I see where more
> simplication along this line can be done. I submitted a patch for our
> test harness:

Oh good.

> In the near future it will be pushed here.

Swell.

One of the blocks in vvp_pgcache_show looks like it
has asymmetric braces though.

	 } else

Perhaps you should be using the linux-next version
of checkpatch which warns about this.

And don't take any of what I wrote as a requirement.

All were merely suggestions and could be implemented
an appropriate time or ignored completely.

  reply	other threads:[~2017-06-15 16:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 15:01 [PATCH 0/6] staging: lustre: lustre: assortment of checkpatch cleanups James Simmons
2017-06-14 15:01 ` [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors James Simmons
2017-06-14 18:10   ` Joe Perches
2017-06-15 16:03     ` James Simmons
2017-06-15 16:19       ` Joe Perches
2017-06-15 16:57         ` James Simmons
2017-06-15 17:04           ` Joe Perches
2017-06-15 17:16             ` James Simmons
2017-06-14 15:01 ` [PATCH 2/6] staging: lustre: lustre: make all struct file_operations constant James Simmons
2017-06-14 15:01 ` [PATCH 3/6] staging: lustre: lustre: fix all bare unsigned usage James Simmons
2017-06-14 15:01 ` [PATCH 4/6] staging: lustre: lustre: add all missing indentifier names James Simmons
2017-06-14 15:01 ` [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups James Simmons
2017-06-14 18:15   ` Joe Perches
2017-06-15 16:06     ` James Simmons
2017-06-15 16:12       ` Joe Perches
2017-06-23 16:12       ` Greg Kroah-Hartman
2017-06-23 16:15   ` Greg Kroah-Hartman
2017-06-14 15:01 ` [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch James Simmons
2017-06-14 18:25   ` Joe Perches
2017-06-15 16:38     ` James Simmons
2017-06-15 16:58       ` Joe Perches [this message]
2017-06-23 16:17   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497545926.14396.11.camel@perches.com \
    --to=joe@perches.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox