Re: [PATCHv8 13/13] I2C: OMAP: simplify omap_i2c_ack_stat()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 18, 2012 at 08:00:28PM +0530, Shubhrajyoti D wrote:
> From: Felipe Balbi <balbi@xxxxxx>
> 
> stat & BIT(1) is the same as BIT(1),

Not true. I'd guess you are missing some context in the patch
description.

> so let's
> simplify things a bit by removing "stat &" from
> all omap_i2c_ack_stat() calls.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> Reviewed-by : Santosh Shilimkar <santosh.shilimkar@xxxxxx>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@xxxxxx>
> ---
>  drivers/i2c/busses/i2c-omap.c |   19 ++++++++++---------
>  1 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 6a79089..bac6305 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -763,7 +763,7 @@ static int errata_omap3_i462(struct omap_i2c_dev *dev, u16 *stat, int *err)
>  
>  	while (--timeout && !(*stat & OMAP_I2C_STAT_XUDF)) {
>  		if (*stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {
> -			omap_i2c_ack_stat(dev, *stat & (OMAP_I2C_STAT_XRDY |
> +			omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_XRDY |
>  							OMAP_I2C_STAT_XDR));
>  			return -ETIMEDOUT;
>  		}
> @@ -824,10 +824,11 @@ complete:
>  		 */
>  		if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
>  					OMAP_I2C_STAT_AL)) {
> -			omap_i2c_ack_stat(dev, stat &
> -				(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
> -				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
> -				OMAP_I2C_STAT_ARDY));
> +			omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY |
> +						OMAP_I2C_STAT_RDR |
> +						OMAP_I2C_STAT_XRDY |
> +						OMAP_I2C_STAT_XDR |
> +						OMAP_I2C_STAT_ARDY));
>  			omap_i2c_complete_cmd(dev, err);
>  			return IRQ_HANDLED;
>  		}
> @@ -874,8 +875,8 @@ complete:
>  					}
>  				}
>  			}
> -			omap_i2c_ack_stat(dev,
> -				stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR));
> +			omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY |
> +						OMAP_I2C_STAT_RDR));
>  			continue;
>  		}
>  
> @@ -922,8 +923,8 @@ complete:
>  
>  				omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w);
>  			}
> -			omap_i2c_ack_stat(dev,
> -				stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
> +			omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_XRDY |
> +						OMAP_I2C_STAT_XDR));
>  			continue;
>  		}
>  
> -- 
> 1.7.5.4
> 

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

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux