From: zhaohaiyang1 <yewentian395@gmail.com>
To: Andi Shyti <andi.shyti@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>
Cc: 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: [PATCH] i2c: bcm2835: add missing braces to for loop in bcm2835_i2c_xfer
Date: Mon, 17 Aug 2026 21:02:34 +0800 [thread overview]
Message-ID: <20260817130234.372628-1-yewentian395@gmail.com> (raw)
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.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
---
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
next reply other threads:[~2026-08-17 13:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 13:02 zhaohaiyang1 [this message]
2026-08-18 14:58 ` [PATCH] i2c: bcm2835: add missing braces to for loop in bcm2835_i2c_xfer Andi Shyti
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=20260817130234.372628-1-yewentian395@gmail.com \
--to=yewentian395@gmail.com \
--cc=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=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