Re: [PATCH 2/3] drivers/fbtft: Remove unnecessary braces from if/else

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux