Skip to contentSkip to conversation

driver i2c-nforce2: fix pointer CodingStyle issues

PATCH In review Laurent Navet 3 participants 8 messages Dec 17, 2012 – Dec 18, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver i2c-nforce2: fix pointer CodingStyle issues

fix these errors reported by checkpatch.pl
- drivers/i2c/busses/i2c-nforce2.c:191
- drivers/i2c/busses/i2c-nforce2.c:193
ERROR: "foo * bar" should be "foo *bar"

- drivers/i2c/busses/i2c-nforce2.c:302:
ERROR: "(foo*)" should be "(foo *)"

---
 drivers/i2c/busses/i2c-nforce2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-nforce2.c +3 -3
index 392303b..9db5ff5 100644
@@ -188,9 +188,9 @@ static int nforce2_check_status(struct i2c_adapter *adap)
 }
 
 /* Return negative errno on error */
-static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
+static s32 nforce2_access(struct i2c_adapter *adap, u16 addr,
 		unsigned short flags, char read_write,
-		u8 command, int size, union i2c_smbus_data * data)
+		u8 command, int size, union i2c_smbus_data *data)
 {
 	struct nforce2_smbus *smbus = adap->algo_data;
 	unsigned char protocol, pec;
@@ -299,7 +299,7 @@ static u32 nforce2_func(struct i2c_adapter *adapter)
 	return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
 	       I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
 	       I2C_FUNC_SMBUS_PEC |
-	       (((struct nforce2_smbus*)adapter->algo_data)->blockops ?
+	       (((struct nforce2_smbus *)adapter->algo_data)->blockops ?
 		I2C_FUNC_SMBUS_BLOCK_DATA : 0);
 }
 
Signature · 1 line
1.7.10.4
#1 lore raw

Hi Laurent,

Quoted 30 lines · Laurent Navet

fix these errors reported by checkpatch.pl
- drivers/i2c/busses/i2c-nforce2.c:191
- drivers/i2c/busses/i2c-nforce2.c:193
ERROR: "foo * bar" should be "foo *bar"

- drivers/i2c/busses/i2c-nforce2.c:302:
ERROR: "(foo*)" should be "(foo *)"

---
 drivers/i2c/busses/i2c-nforce2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-nforce2.c +2 -2
index 392303b..9db5ff5 100644
@@ -188,9 +188,9 @@ static int nforce2_check_status(struct i2c_adapter *adap)
 }
 
 /* Return negative errno on error */
-static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
+static s32 nforce2_access(struct i2c_adapter *adap, u16 addr,
 		unsigned short flags, char read_write,
-		u8 command, int size, union i2c_smbus_data * data)
+		u8 command, int size, union i2c_smbus_data *data)
 {
 	struct nforce2_smbus *smbus = adap->algo_data;
 	unsigned char protocol, pec;

drivers/i2c/busses/i2c-nforce2.c static u32 nforce2_func(struct i2c_adapter *adapter) · line 305

Quoted 8 lines
drivers/i2c/busses/i2c-nforce2.c +1 -1
@@ -299,7 +299,7 @@ static u32 nforce2_func(struct i2c_adapter *adapter)
 	return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
 	       I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
 	       I2C_FUNC_SMBUS_PEC |
-	       (((struct nforce2_smbus*)adapter->algo_data)->blockops ?
+	       (((struct nforce2_smbus *)adapter->algo_data)->blockops ?
 		I2C_FUNC_SMBUS_BLOCK_DATA : 0);
 }
 

This is correct, however there are several other checkpatch errors and warnings in this file and I would appreciate if you could fix them as well. I'm not asking that you fix them all, but please consider fixing the following:

WARNING: space prohibited between function name and open parenthesis '(' #63: FILE: i2c/busses/i2c-nforce2.c:63:
+MODULE_AUTHOR ("Hans-Frieder Vogt <[email protected]>");

WARNING: suspect code indent for conditional statements (24, 33) #226: FILE: i2c/busses/i2c-nforce2.c:226:
+ if (read_write == I2C_SMBUS_WRITE) {
+ outb_p(data->word, NVIDIA_SMB_DATA);

WARNING: line over 80 characters
#275: FILE: i2c/busses/i2c-nforce2.c:275:
+ data->word = inb_p(NVIDIA_SMB_DATA) | (inb_p(NVIDIA_SMB_DATA+1) << 8);

WARNING: quoted string split across lines
#282: FILE: i2c/busses/i2c-nforce2.c:282:
+ dev_err(&adap->dev, "Transaction failed "
+ "(received block size: 0x%02x)\n",

WARNING: space prohibited between function name and open parenthesis '(' #330: FILE: i2c/busses/i2c-nforce2.c:330:
+MODULE_DEVICE_TABLE (pci, nforce2_ids);

WARNING: line over 80 characters
#380: FILE: i2c/busses/i2c-nforce2.c:380:
+ dev_info(&smbus->adapter.dev, "nForce2 SMBus adapter at %#x\n", smbus->base);

ERROR: space required before the open parenthesis '(' #395: FILE: i2c/busses/i2c-nforce2.c:395:
+ switch(dev->device) {

These are simple coding style issues, very easy to fix.

Thanks,

Signature · 1 line
Jean Delvare
#2 lore raw

Hi guys,

Quoted 36 lines

This is correct, however there are several other checkpatch errors and warnings in this file and I would appreciate if you could fix them as well. I'm not asking that you fix them all, but please consider fixing the following:

WARNING: space prohibited between function name and open parenthesis '(' #63: FILE: i2c/busses/i2c-nforce2.c:63:
+MODULE_AUTHOR ("Hans-Frieder Vogt <[email protected]>");

WARNING: suspect code indent for conditional statements (24, 33) #226: FILE: i2c/busses/i2c-nforce2.c:226:

(quoted diff) +2 -0
+			if (read_write == I2C_SMBUS_WRITE) {
+				 outb_p(data->word, NVIDIA_SMB_DATA);

WARNING: line over 80 characters
#275: FILE: i2c/busses/i2c-nforce2.c:275:

(quoted diff) +1 -0
+			data->word = inb_p(NVIDIA_SMB_DATA) | (inb_p(NVIDIA_SMB_DATA+1) << 8);

WARNING: quoted string split across lines
#282: FILE: i2c/busses/i2c-nforce2.c:282:

(quoted diff) +2 -0
+				dev_err(&adap->dev, "Transaction failed "
+					"(received block size: 0x%02x)\n",

WARNING: space prohibited between function name and open parenthesis '(' #330: FILE: i2c/busses/i2c-nforce2.c:330:
+MODULE_DEVICE_TABLE (pci, nforce2_ids);

WARNING: line over 80 characters
#380: FILE: i2c/busses/i2c-nforce2.c:380:

(quoted diff) +1 -0
+	dev_info(&smbus->adapter.dev, "nForce2 SMBus adapter at %#x\n",

smbus->base);

ERROR: space required before the open parenthesis '(' #395: FILE: i2c/busses/i2c-nforce2.c:395:

(quoted diff) +1 -0
+	switch(dev->device) {
Quoted 1 line

These are simple coding style issues, very easy to fix.

i have planned fixing these too, do you prefer one patch fixing all or multiple patches (one per error/warning type )?

regards,
Laurent.

#3 lore raw
Quoted 3 lines

i have planned fixing these too, do you prefer one patch fixing all or multiple patches (one per error/warning type )?

One patch, definately. You can skip the 80 char thing. Are you also able to build-test the changes?

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#4 lore raw
Quoted 5 lines · Wolfram Sang
Quoted 3 lines

i have planned fixing these too, do you prefer one patch fixing all or multiple patches (one per error/warning type )?

One patch, definately.

Yes please :)

Quoted 1 line

You can skip the 80 char thing.

For PCI device IDs, agreed.

Quoted 1 line

Are you also able to build-test the changes?

Most certainly yes, this driver has almost no dependencies. I will build-test it anyway.

Signature · 1 line
Jean Delvare
#5 lore raw
Quoted 5 lines
Quoted 2 lines

Are you also able to build-test the changes?

Most certainly yes, this driver has almost no dependencies. I will build-test it anyway.

Me too :) I just wanted to express that I would love to see a compile test before submission, even for checkpatch thingies. Can save some hazzle for all of us.

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#7 lore raw
In reply to a message not in the archive
Quoted 1 line · wenhao zhang

*A Stupid Question*

This is not a stupid question, but a completely OFF-TOPIC question. Don't do that again, please. If you have a question to ask, start a new discussion thread on the appropriate list.

Thanks,

Signature · 1 line
Jean Delvare
#8 lore raw
In reply to Wolfram Sang
Quoted 1 line
Quoted 1 line
Quoted 1 line

Are you also able to build-test the changes?

Yes,

Quoted 4 lines

Me too :) I just wanted to express that I would love to see a compile test before submission, even for checkpatch thingies. Can save some hazzle for all of us.

I agree,

thanks for your comments, i'll send new patch in a few days.