public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Luis Gerhorst" <linux-kernel@luisgerhorst.de>,
	devel@driverdev.osuosl.org, linux-kernel@i4.cs.fau.de,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	"Jonny Schäfer" <schaefer.jonny@gmail.com>
Subject: Re: [PATCH 2/3] drivers/fbtft: Remove unnecessary braces from if/else
Date: Mon, 08 Jan 2018 11:48:12 -0800	[thread overview]
Message-ID: <1515440892.9619.52.camel@perches.com> (raw)
In-Reply-To: <20180108192646.jqr4hdif2i5cpxr6@mwanda>

On Mon, 2018-01-08 at 22:26 +0300, Dan Carpenter wrote:
> On Mon, Jan 08, 2018 at 10:27:01AM -0800, Joe Perches wrote:
> > On Mon, 2018-01-08 at 18:03 +0300, Dan Carpenter wrote:
> > > On Mon, Jan 08, 2018 at 11:06:37AM +0100, Luis Gerhorst wrote:
> > > > The Linux kernel coding style states that braces should only be used
> > > > when necessary.
> > > > 
> > > > This fixes the checkpatch warning
> > > > 
> > > > WARNING: line over 80 characters
> > > > +	} else if (display->regwidth == 8 && display->buswidth == 9 && par->spi) {
> > > > 
> > > > introduced by patch #1.
> > > > 
> > > 
> > > Don't introduce warnings and then fix them in later patches.

Hey Dan.

btw: I completely agree with this

> > > Anyway there is another unwritten rule that multi-line indents get curly
> > > braces.  Probably it should be:
> > 
> > Nope.  That'd be your own preferred style.
> > 
> I copied it from Greg so it's the subsystem style.

I don't fine any examples that match your
suggestion above in drivers/staging/fbtft.

Perhaps because there aren't many multi line
if statements.

All of the blocks that use braces are required
because one or more of the if/else blocks
contain multiple statements.

There are counterexamples in the subsystem.

cheers, Joe

  reply	other threads:[~2018-01-08 19:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 10:06 [PATCH 2/3] drivers/fbtft: Remove unnecessary braces from if/else Luis Gerhorst
2018-01-08 15:03 ` Dan Carpenter
2018-01-08 18:27   ` Joe Perches
2018-01-08 19:26     ` Dan Carpenter
2018-01-08 19:48       ` Joe Perches [this message]
2018-01-08 20:35         ` Dan Carpenter

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=1515440892.9619.52.camel@perches.com \
    --to=joe@perches.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@i4.cs.fau.de \
    --cc=linux-kernel@luisgerhorst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schaefer.jonny@gmail.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