linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Jean Delvare <khali@linux-fr.org>
Cc: Farid Hammane <farid.hammane@gmail.com>,
	ben-linux@fluff.org, Enrik.Berkhan@ge.com,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c-algo-pca: fix all coding style issues in i2c-algo-pca.c
Date: Thu, 22 Apr 2010 09:59:37 +0200	[thread overview]
Message-ID: <20100422075937.GN24384@pengutronix.de> (raw)
In-Reply-To: <20100422092524.77b7aa84@hyperion.delvare>

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

On Thu, Apr 22, 2010 at 09:25:24AM +0200, Jean Delvare wrote:
> On Thu, 22 Apr 2010 01:57:38 +0200, Wolfram Sang wrote:
> > Hi Farid,
> > 
> > thanks for this approach. Have you checked that the binary is the same
> > before/after your patch? If so, please mention in your patch description.
> > 
> > Also, always keep in mind that checkpatch helps to make code readable. Some of
> > your changes should keep readability in mind not just fixing the warnings.
> > 
> > On Wed, Apr 21, 2010 at 09:11:37PM +0200, Farid Hammane wrote:
> > > This patch fixes all coding style issues found by checkpatch.pl.
> > 
> > > 
> > > Signed-off-by: Farid Hammane <farid.hammane@gmail.com>
> > > ---
> > >  drivers/i2c/algos/i2c-algo-pca.c |   74 ++++++++++++++++++++++---------------
> > >  1 files changed, 44 insertions(+), 30 deletions(-)
> > > 
> > > diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
> > > (...)
> > > @@ -178,12 +178,12 @@ static int pca_rx_ack(struct i2c_algo_pca_data *adap,
> > >  }
> > >  
> > >  static int pca_xfer(struct i2c_adapter *i2c_adap,
> > > -                    struct i2c_msg *msgs,
> > > -                    int num)
> > > +		struct i2c_msg *msgs,
> > > +		int num)
> > 
> > One more tab maybe?
> 
> Better use tab + spaces and align on the opening parenthesis. What
> checkpatch.pl complains about here isn't the alignment, it's the use of
> more than 8 consecutive spaces.
> 

OK

> > > (...)
> > > @@ -241,8 +244,10 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
> > >  			completed = pca_address(adap, msg);
> > >  			break;
> > >  
> > > -		case 0x18: /* SLA+W has been transmitted; ACK has been received */
> > > -		case 0x28: /* Data byte in I2CDAT has been transmitted; ACK has been received */
> > > +		case 0x18: /* SLA+W has been transmitted;
> > > +			      ACK has been received */
> > > +		case 0x28: /* Data byte in I2CDAT has been transmitted;
> > > +			      ACK has been received */
> > 
> > First, check CodingStyle for how multiline comments should look like. For
> > readability, I'd like to keep them single line, though. I think this could
> > be done by rewording. Same for all following comments.
> 
> Please keep in mind that Farid doesn't know the code. He is "only"
> helping with formatting cleanups. Asking him to reword the comments

I think s/has been//g will help already. And getting accoustomed to the code
you are modifying is not that bad ;)

> doesn't seem wise. And there's nothing wrong with two-line comments as
> above. The "preferred comment format" in CodingStyle is often
> unrealistic IMHO, I'm not always following it in my own code.

I disagree here. I'd rather break the 80 columns limit than having multiline
comments not really standing out.

Also, I feel a bit uneasy as changing the comments spoils the history for
git-blame in case you want to know when/if the state-machine was changed. Then
again, I like properly formatted code.

Summa summarum, just send V2, it's not really worth fighting over it :)

Regards,

   Wolfram

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

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

  reply	other threads:[~2010-04-22  7:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 19:11 [PATCH] i2c-algo-pca: fix all coding style issues in i2c-algo-pca.c Farid Hammane
     [not found] ` <1271877097-10939-1-git-send-email-farid.hammane-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-04-21 23:57   ` Wolfram Sang
     [not found]     ` <20100421235738.GB24384-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-22  7:25       ` Jean Delvare
2010-04-22  7:59         ` Wolfram Sang [this message]
     [not found]           ` <20100422075937.GN24384-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-22 21:30             ` Farid Hammane
     [not found]               ` <201004222330.34660.farid.hammane-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-04-23  8:13                 ` Jean Delvare

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=20100422075937.GN24384@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=Enrik.Berkhan@ge.com \
    --cc=ben-linux@fluff.org \
    --cc=farid.hammane@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).