The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Laurent Navet <laurent.navet@gmail.com>
Cc: w.sang@pengutronix.de, ben-linux@fluff.org,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues
Date: Tue, 18 Dec 2012 10:52:23 +0100	[thread overview]
Message-ID: <20121218105223.0184d4a3@endymion.delvare> (raw)
In-Reply-To: <1355778259-8445-1-git-send-email-laurent.navet@gmail.com>

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@gmail.com>
> ---
>  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@gmx.net>");

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

  reply	other threads:[~2012-12-18  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 21:04 [PATCH] driver i2c-nforce2: fix pointer CodingStyle issues Laurent Navet
2012-12-18  9:52 ` Jean Delvare [this message]
2012-12-18 10:05   ` Laurent Navet
2012-12-18 10:09     ` Wolfram Sang
2012-12-18 10:23       ` Jean Delvare
2012-12-18 10:30         ` Wolfram Sang
     [not found]           ` <CADiHX-AwjQkD6USqomhouSzAsniK-eMcanrp8MbQF4MZWH=cSg@mail.gmail.com>
2012-12-18 10:50             ` Jean Delvare
2012-12-18 11:10           ` Laurent Navet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121218105223.0184d4a3@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=ben-linux@fluff.org \
    --cc=laurent.navet@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox