Re: [PATCH 3/3] i2c: imx: whitespace and checkpatch cleanup

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

 



On Tue, Jan 06, 2015 at 03:48:21PM +0100, Philipp Zabel wrote:
> This patch fixes up some whitespace issues and addresses a few
> checkpatch warnings.

Well, since you asked for it... I am not so strict with the 80 char
limit:

> @@ -527,8 +528,10 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx)
>  		return result;
>  	imx_i2c_write_reg(i2c_imx->ifdr, i2c_imx, IMX_I2C_IFDR);
>  	/* Enable I2C controller */
> -	imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR);
> -	imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode, i2c_imx, IMX_I2C_I2CR);
> +	imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx,
> +			  IMX_I2C_I2SR);
> +	imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode, i2c_imx,
> +			  IMX_I2C_I2CR);

Please keep the old way, this is not more readable.

> @@ -781,7 +784,8 @@ static int i2c_imx_write(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs)
>  	return 0;
>  }
>  
> -static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bool is_lastmsg)
> +static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs,
> +			bool is_lastmsg)

ditto

> @@ -843,8 +848,9 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
>  		if (i == (msgs->len - 1)) {
>  			if (is_lastmsg) {
>  				/*
> -				 * It must generate STOP before read I2DR to prevent
> -				 * controller from generating another clock cycle
> +				 * It must generate STOP before read I2DR to
> +				 * prevent controller from generating another
> +				 * clock cycle

ditto

> @@ -855,11 +861,13 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
>  				i2c_imx->stopped = 1;
>  			} else {
>  				/*
> -				 * For i2c master receiver repeat restart operation like:
> +				 * For i2c master receiver repeat restart
> +				 * operation like:
>  				 * read -> repeat MSTA -> read/write
> -				 * The controller must set MTX before read the last byte in
> -				 * the first read operation, otherwise the first read cost
> -				 * one extra clock cycle.
> +				 * The controller must set MTX before read the
> +				 * last byte in the first read operation,
> +				 * otherwise the first read cost one extra clock
> +				 * cycle.

ditto

> @@ -918,15 +926,16 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
>  		/* write/read data */
>  #ifdef CONFIG_I2C_DEBUG_BUS
>  		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
> -		dev_dbg(&i2c_imx->adapter.dev, "<%s> CONTROL: IEN=%d, IIEN=%d, "
> -			"MSTA=%d, MTX=%d, TXAK=%d, RSTA=%d\n", __func__,
> +		dev_dbg(&i2c_imx->adapter.dev,
> +			"<%s> CONTROL: IEN=%d, IIEN=%d, MSTA=%d, MTX=%d, TXAK=%d, RSTA=%d\n",
> +			__func__,

This is better than before, good.

>  			(temp & I2CR_IEN ? 1 : 0), (temp & I2CR_IIEN ? 1 : 0),
>  			(temp & I2CR_MSTA ? 1 : 0), (temp & I2CR_MTX ? 1 : 0),
>  			(temp & I2CR_TXAK ? 1 : 0), (temp & I2CR_RSTA ? 1 : 0));
>  		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
>  		dev_dbg(&i2c_imx->adapter.dev,
> -			"<%s> STATUS: ICF=%d, IAAS=%d, IBB=%d, "
> -			"IAL=%d, SRW=%d, IIF=%d, RXAK=%d\n", __func__,
> +			"<%s> STATUS: ICF=%d, IAAS=%d, IBB=%d, IAL=%d, SRW=%d, IIF=%d, RXAK=%d\n",
> +			__func__,

ditto

> @@ -1001,11 +1010,12 @@ static int i2c_imx_probe(struct platform_device *pdev)
>  				platform_get_device_id(pdev)->driver_data;
>  
>  	/* Setup i2c_imx driver structure */
> -	strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
> +	strlcpy(i2c_imx->adapter.name, pdev->name,
> +		sizeof(i2c_imx->adapter.name));

This not IMO.

> @@ -1045,7 +1055,8 @@ static int i2c_imx_probe(struct platform_device *pdev)
>  	/* Set up chip registers to defaults */
>  	imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode ^ I2CR_IEN,
>  			i2c_imx, IMX_I2C_I2CR);
> -	imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR);
> +	imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx,
> +			  IMX_I2C_I2SR);

ditto

Rest is appreciated, thanks.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux