public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
@ 2012-12-17 21:04 Laurent Navet
       [not found] ` <1355778259-8445-1-git-send-email-laurent.navet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Navet @ 2012-12-17 21:04 UTC (permalink / raw)
  To: khali-PUYAD+kWke1g9hUCZPvPmw
  Cc: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, 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 *)"

Signed-off-by: Laurent Navet <laurent.navet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/i2c/busses/i2c-nforce2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 392303b..9db5ff5 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -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);
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found] ` <1355778259-8445-1-git-send-email-laurent.navet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-12-18  9:52   ` Jean Delvare
       [not found]     ` <20121218105223.0184d4a3-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Delvare @ 2012-12-18  9:52 UTC (permalink / raw)
  To: Laurent Navet
  Cc: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Hi Laurent,

On Mon, 17 Dec 2012 22:04:19 +0100, Laurent Navet wrote:
> 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 *)"
> 
> Signed-off-by: Laurent Navet <laurent.navet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-nforce2.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
> index 392303b..9db5ff5 100644
> --- a/drivers/i2c/busses/i2c-nforce2.c
> +++ b/drivers/i2c/busses/i2c-nforce2.c
> @@ -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);
>  }
>  

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 <hfvogt-hi6Y0CQ0nG0@public.gmane.org>");

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,
-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found]     ` <20121218105223.0184d4a3-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-12-18 10:05       ` Laurent Navet
       [not found]         ` <CAH7P7Nhz2FpBct4afvAXU2Zgi-yA4TkJj7CtYMaW7pXr6weZig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Navet @ 2012-12-18 10:05 UTC (permalink / raw)
  To: Jean Delvare
  Cc: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Hi guys,

> 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 <hfvogt-hi6Y0CQ0nG0@public.gmane.org>");
>
> 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.

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

regards,
Laurent.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found]         ` <CAH7P7Nhz2FpBct4afvAXU2Zgi-yA4TkJj7CtYMaW7pXr6weZig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-12-18 10:09           ` Wolfram Sang
       [not found]             ` <20121218100906.GB2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2012-12-18 10:09 UTC (permalink / raw)
  To: Laurent Navet
  Cc: Jean Delvare, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]


> 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?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found]             ` <20121218100906.GB2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-12-18 10:23               ` Jean Delvare
       [not found]                 ` <20121218112355.69369ee1-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Delvare @ 2012-12-18 10:23 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Laurent Navet, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Tue, 18 Dec 2012 11:09:06 +0100, Wolfram Sang wrote:
> 
> > 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 :)
> You can skip the 80 char thing.

For PCI device IDs, agreed.

> Are you also able to build-test the changes?

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


-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found]                 ` <20121218112355.69369ee1-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-12-18 10:30                   ` Wolfram Sang
       [not found]                     ` <CADiHX-AwjQkD6USqomhouSzAsniK-eMcanrp8MbQF4MZWH=cSg@mail.gmail.com>
       [not found]                     ` <20121218103037.GC2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Wolfram Sang @ 2012-12-18 10:30 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Laurent Navet, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]


> > 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.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found]                       ` <CADiHX-AwjQkD6USqomhouSzAsniK-eMcanrp8MbQF4MZWH=cSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-12-18 10:50                         ` Jean Delvare
  0 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2012-12-18 10:50 UTC (permalink / raw)
  To: wenhao zhang
  Cc: Wolfram Sang, Laurent Navet, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Tue, 18 Dec 2012 18:38:20 +0800, wenhao zhang wrote:
> *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,
-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
       [not found]                     ` <20121218103037.GC2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-12-18 11:10                       ` Laurent Navet
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Navet @ 2012-12-18 11:10 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Jean Delvare, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

>> > Are you also able to build-test the changes?
Yes,

> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-18 11:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 21:04 [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues Laurent Navet
     [not found] ` <1355778259-8445-1-git-send-email-laurent.navet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-18  9:52   ` Jean Delvare
     [not found]     ` <20121218105223.0184d4a3-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-18 10:05       ` Laurent Navet
     [not found]         ` <CAH7P7Nhz2FpBct4afvAXU2Zgi-yA4TkJj7CtYMaW7pXr6weZig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-18 10:09           ` Wolfram Sang
     [not found]             ` <20121218100906.GB2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-12-18 10:23               ` Jean Delvare
     [not found]                 ` <20121218112355.69369ee1-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-18 10:30                   ` Wolfram Sang
     [not found]                     ` <CADiHX-AwjQkD6USqomhouSzAsniK-eMcanrp8MbQF4MZWH=cSg@mail.gmail.com>
     [not found]                       ` <CADiHX-AwjQkD6USqomhouSzAsniK-eMcanrp8MbQF4MZWH=cSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-18 10:50                         ` Jean Delvare
     [not found]                     ` <20121218103037.GC2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-12-18 11:10                       ` Laurent Navet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox