public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Yegor Yefremov <yegor_sub1-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org
Subject: Re: [PATCH] fix i2c_pca_pf_waitforcompletion() return value
Date: Wed, 22 Sep 2010 11:04:41 +0200	[thread overview]
Message-ID: <20100922090441.GB2693@pengutronix.de> (raw)
In-Reply-To: <4C99C479.7040902-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>

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

Hi Yegor,

looks good in general. Just a few whitespace issues. When you fixed them
you can send a proper patch with the renamed patch description and my

Reviewed-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>


On Wed, Sep 22, 2010 at 10:55:21AM +0200, Yegor Yefremov wrote:
> Index: b/drivers/i2c/busses/i2c-pca-platform.c
> ===================================================================
> --- a/drivers/i2c/busses/i2c-pca-platform.c	2010-09-22 09:31:12.000000000 +0200
> +++ b/drivers/i2c/busses/i2c-pca-platform.c	2010-09-22 10:47:13.000000000 +0200
> @@ -80,8 +80,8 @@
>  static int i2c_pca_pf_waitforcompletion(void *pd)
>  {
>  	struct i2c_pca_pf_data *i2c = pd;
> -	long ret = ~0;
>  	unsigned long timeout;
> +	long ret;
>  
>  	if (i2c->irq) {
>  		ret = wait_event_timeout(i2c->wait,
> @@ -90,10 +90,13 @@
>  	} else {
>  		/* Do polling */
>  		timeout = jiffies + i2c->adap.timeout;
> -		while (((i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
> -				& I2C_PCA_CON_SI) == 0)
> -				&& (ret = time_before(jiffies, timeout)))
> +		do {
> +			ret = time_before(jiffies, timeout);
> +			if (i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
> +					& I2C_PCA_CON_SI)

Add one or two tabs to the above line. I missed that, too. It looks
strange if this line is on the same indentation level as the 'break'
below.

> +				break;
>  			udelay(100);
> +		} while (ret);
>  	}
>  
>  	return ret > 0;
> Index: b/drivers/i2c/busses/i2c-pca-isa.c
> ===================================================================
> --- a/drivers/i2c/busses/i2c-pca-isa.c	2010-08-27 01:47:12.000000000 +0200
> +++ b/drivers/i2c/busses/i2c-pca-isa.c	2010-09-22 10:47:10.000000000 +0200
> @@ -71,8 +71,8 @@
>  
>  static int pca_isa_waitforcompletion(void *pd)
>  {
> -	long ret = ~0;
>  	unsigned long timeout;
> +	long ret;
>  
>  	if (irq > -1) {
>  		ret = wait_event_timeout(pca_wait,
> @@ -81,11 +81,15 @@
>  	} else {
>  		/* Do polling */
>  		timeout = jiffies + pca_isa_ops.timeout;
> -		while (((pca_isa_readbyte(pd, I2C_PCA_CON)
> -				& I2C_PCA_CON_SI) == 0)
> -				&& (ret = time_before(jiffies, timeout)))
> +		do {
> +			ret = time_before(jiffies, timeout);
> +			if (pca_isa_readbyte(pd, I2C_PCA_CON)
> +				& I2C_PCA_CON_SI)

ditto.

> +				break;
>  			udelay(100);
> +		}while(ret);

Missing space.

>  	}
> +
>  	return ret > 0;
>  }
>  
> 

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

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

      parent reply	other threads:[~2010-09-22  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20  9:14 [PATCH] fix i2c_pca_pf_waitforcompletion() return value Yegor Yefremov
     [not found] ` <4C9725F8.1080200-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-21  5:41   ` Wolfram Sang
     [not found]     ` <20100921054150.GA29281-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-09-21 13:59       ` Yegor Yefremov
     [not found]         ` <4C98BA51.3000209-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-22  8:55           ` Yegor Yefremov
     [not found]             ` <4C99C479.7040902-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-22  9:04               ` Wolfram Sang [this message]

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=20100922090441.GB2693@pengutronix.de \
    --to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yegor_sub1-ZJVcf1zZPRSebONBosFW4Q@public.gmane.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