From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Fugang Duan <B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Yao Yuan <yao.yuan-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org
Subject: Re: [PATCH 3/3] i2c: imx: whitespace and checkpatch cleanup
Date: Wed, 14 Jan 2015 15:25:16 +0100 [thread overview]
Message-ID: <20150114142516.GC1598@katana> (raw)
In-Reply-To: <1420555701-24645-3-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 4103 bytes --]
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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-14 14:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 14:48 [PATCH 1/3] i2c: imx: silence dma_request_slave_channel errors if dma not set up in device tree Philipp Zabel
[not found] ` <1420555701-24645-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-06 14:48 ` [PATCH 2/3] i2c: imx: remove unused return value assignments Philipp Zabel
[not found] ` <1420555701-24645-2-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-07 2:51 ` fugang.duan-KZfg59tc24xl57MIdRCFDg
2015-01-14 14:20 ` Wolfram Sang
2015-01-06 14:48 ` [PATCH 3/3] i2c: imx: whitespace and checkpatch cleanup Philipp Zabel
[not found] ` <1420555701-24645-3-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-07 2:36 ` fugang.duan-KZfg59tc24xl57MIdRCFDg
[not found] ` <BLUPR03MB3730EFCF20035ADB0027ABAF5460-GeMU99GfrrsHjcGqcGfFzOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2015-01-07 11:01 ` Philipp Zabel
[not found] ` <1420628513.3191.30.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-07 11:13 ` fugang.duan-KZfg59tc24xl57MIdRCFDg
2015-01-14 14:25 ` Wolfram Sang [this message]
2015-01-14 14:48 ` Philipp Zabel
2015-01-07 2:31 ` [PATCH 1/3] i2c: imx: silence dma_request_slave_channel errors if dma not set up in device tree fugang.duan-KZfg59tc24xl57MIdRCFDg
2015-01-14 14:14 ` Wolfram Sang
2015-01-22 14:33 ` Wolfram Sang
2015-01-22 14:48 ` Philipp Zabel
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=20150114142516.GC1598@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=yao.yuan-KZfg59tc24xl57MIdRCFDg@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;
as well as URLs for NNTP newsgroup(s).