Re: [PATCH v3] i2c: new bus driver for efm32

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

 




On Tue, 2014-03-25 at 10:11 +0100, Wolfram Sang wrote:
> On Tue, Mar 25, 2014 at 10:07:00AM +0100, Uwe Kleine-König wrote:
> > Hello,
> > 
> > On Mon, Mar 24, 2014 at 06:01:31PM +0100, Wolfram Sang wrote:
> > > And checkpatch said:
> > > 
> > > WARNING: braces {} are not necessary for any arm of this statement
> > > #345: FILE: drivers/i2c/busses/i2c-efm32.c:239:
> > > +		if (cur_msg->flags & I2C_M_RD) {
> > > ...
> > hmm the whole block reads:
> > 
> >         case REG_STATE_STATE_DATA:
> >                 if (cur_msg->flags & I2C_M_RD) {
> >                         efm32_i2c_recv_next_byte(ddata);
> >                 } else {
> >                         /* wait for Ack or Nack of slave */
> >                 }
> >                 break;
> > 
> > so just removing the braces does the wrong thing. Is this a false
> > positive checkpatch warning? Andy? Joe?
> > 
> > I can make it:
> > 
> > 		if (cur_msg->flags & I2C_M_RD)
> > 			efm32_i2c_recv_next_byte(ddata);
> > 		/* in the write case wait for Ack or Nack of slave */
> > 
> > but I consider the version above more readable.
> 
> Well, OK, I let you decide.

A Semi-Positive I think.

I think your first block is more readable myself.

Adding a semicolon would shut checkpatch up and it's
debatable whether it might be better too.

	if (foo) {
		bar();
	} else {
		/* single line comment */
		;
	}

But please feel free to ignore any checkpatch warning
where your taste is better than its.

checkpatch is brainless, you're not.


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux