From: Andi Shyti <andi.shyti@kernel.org>
To: zhaohaiyang1 <yewentian395@gmail.com>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
linux-i2c@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
Subject: Re: [PATCH] i2c: bcm2835: add missing braces to for loop in bcm2835_i2c_xfer
Date: Tue, 18 Aug 2026 16:58:13 +0200 [thread overview]
Message-ID: <aoRysYp25Ni4jMaL@zenone.zhora.eu> (raw)
In-Reply-To: <20260817130234.372628-1-yewentian395@gmail.com>
Hi,
On Mon, Aug 17, 2026 at 09:02:34PM +0800, zhaohaiyang1 wrote:
> From: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
>
> Add curly braces around the multi-statement body of the for loop
> that checks for unsupported read messages. This fixes a coding
> style issue where the compound statement lacked explicit braces.
it's not a multi statement body, if you look very carefully from
closer, there is only one single solitary 'if' statement.
> Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
Please next time use your real name here.
Thanks,
Andi
> ---
> drivers/i2c/busses/i2c-bcm2835.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
> index 8554e790f8e3..76d017cf1582 100644
> --- a/drivers/i2c/busses/i2c-bcm2835.c
> +++ b/drivers/i2c/busses/i2c-bcm2835.c
> @@ -349,12 +349,13 @@ static int bcm2835_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
> unsigned long time_left;
> int i;
>
> - for (i = 0; i < (num - 1); i++)
> + for (i = 0; i < (num - 1); i++) {
> if (msgs[i].flags & I2C_M_RD) {
> dev_warn_once(i2c_dev->dev,
> "only one read message supported, has to be last\n");
> return -EOPNOTSUPP;
> }
> + }
>
> i2c_dev->curr_msg = msgs;
> i2c_dev->num_msgs = num;
> --
> 2.43.0
>
prev parent reply other threads:[~2026-08-18 14:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 13:02 [PATCH] i2c: bcm2835: add missing braces to for loop in bcm2835_i2c_xfer zhaohaiyang1
2026-08-18 14:58 ` Andi Shyti [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=aoRysYp25Ni4jMaL@zenone.zhora.eu \
--to=andi.shyti@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=yewentian395@gmail.com \
--cc=zhaohaiyang1@xiaomi.com \
/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