Re: [PATCH 2/3] i2c: i2c-core: fix coding style issues in i2c-core.c

From: Wolfram Sang
Date: Tue Jan 14 2014 - 13:37:10 EST


On Mon, Oct 14, 2013 at 08:53:07PM +0530, RAGHAVENDRA GANIGA wrote:
> From b21e6a52aa9c36e8c01173cff13bbfd2a380d0bd Mon Sep 17 00:00:00 2001
> From: Raghavendra Ganiga <ravi23ganiga@xxxxxxxxx>
> Date: Mon, 14 Oct 2013 00:29:08 +0530
> Subject: [PATCH 2/3] i2c: i2c-core: fix coding style issues in i2c-core.c
>
> This is a patch to the i2c-core.c file that fixes up warnings and
> the code indent error reported by the checkpatch.pl tool

Please describe which warnings.

> @@ -1737,9 +1735,10 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> if (adap->algo->master_xfer) {
> #ifdef DEBUG
> for (ret = 0; ret < num; ret++) {
> - dev_dbg(&adap->dev, "master_xfer[%d] %c, addr=0x%02x, "
> - "len=%d%s\n", ret, (msgs[ret].flags & I2C_M_RD)
> - ? 'R' : 'W', msgs[ret].addr, msgs[ret].len,
> + dev_dbg(&adap->dev, "master_xfer[%d] %c, addr=0x%02x, len=%d%s\n",
> + ret,
> + ((msgs[ret].flags & I2C_M_RD) ? 'R' : 'W'),
> + msgs[ret].addr, msgs[ret].len,
> (msgs[ret].flags & I2C_M_RECV_LEN) ? "+" : "");

You added some extra paranthesis here? No need to. Also ret doesn't need
to be in a seperate line.

> }
> #endif
> @@ -1905,8 +1904,9 @@ static int i2c_detect_address(struct i2c_client *temp_client,
>
> /* Consistency check */
> if (info.type[0] == '\0') {
> - dev_err(&adapter->dev, "%s detection function provided "
> - "no name for 0x%x\n", driver->driver.name,
> + dev_err(&adapter->dev,
> + "%s detection function provided no name for 0x%x\n",
> + driver->driver.name,
> addr);

'addr' is dangling.

And merge 1/3 into it.

Attachment: signature.asc
Description: Digital signature