[PATCH v3] i2c: new bus driver for efm32

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Mar 25 05:07:00 EDT 2014


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.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the linux-arm-kernel mailing list