From: Slawomir Stepien <sst@poczta.fm>
To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
knaack.h@gmx.de, pmeerw@pmeerw.net
Cc: linux-iio@vger.kernel.org, gregkh@linuxfoundation.org
Subject: [PATCH 3/3] staging: iio: adc: ad7280a: add braces to complex for loops
Date: Sun, 2 Dec 2018 12:58:30 +0100 [thread overview]
Message-ID: <20181202115830.20363-4-sst@poczta.fm> (raw)
In-Reply-To: <20181202115830.20363-1-sst@poczta.fm>
These for loops have just only one instruction as its body. However this
body is complex, so add braces to them.
Signed-off-by: Slawomir Stepien <sst@poczta.fm>
---
drivers/staging/iio/adc/ad7280a.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 6faa85bf6f7e..6ec5a0d2a438 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -574,7 +574,7 @@ static int ad7280_channel_init(struct ad7280_state *st)
if (!st->channels)
return -ENOMEM;
- for (dev = 0, cnt = 0; dev <= st->slave_num; dev++)
+ for (dev = 0, cnt = 0; dev <= st->slave_num; dev++) {
for (ch = AD7280A_CELL_VOLTAGE_1; ch <= AD7280A_AUX_ADC_6;
ch++, cnt++) {
if (ch < AD7280A_AUX_ADC_1)
@@ -584,6 +584,7 @@ static int ad7280_channel_init(struct ad7280_state *st)
ad7280_common_fields_init(st, cnt, dev, ch);
}
+ }
ad7280_all_voltage_channel_init(st, cnt, dev);
cnt++;
@@ -642,7 +643,7 @@ static int ad7280_attr_init(struct ad7280_state *st)
if (!st->iio_attr)
return -ENOMEM;
- for (dev = 0, cnt = 0; dev <= st->slave_num; dev++)
+ for (dev = 0, cnt = 0; dev <= st->slave_num; dev++) {
for (ch = AD7280A_CELL_VOLTAGE_1; ch <= AD7280A_CELL_VOLTAGE_6;
ch++, cnt++) {
ret = ad7280_balance_switch_attr_init(st, cnt, dev, ch);
@@ -654,6 +655,7 @@ static int ad7280_attr_init(struct ad7280_state *st)
if (ret < 0)
return ret;
}
+ }
ad7280_attributes[cnt] = NULL;
--
2.19.2
next prev parent reply other threads:[~2018-12-02 11:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-02 11:58 [PATCH 0/3] staging: iio: adc: ad7280a: channel and attr init refactor Slawomir Stepien
2018-12-02 11:58 ` [PATCH 1/3] staging: iio: adc: ad7280a: split ad7280_channel_init() to more functions Slawomir Stepien
2018-12-02 15:45 ` Jonathan Cameron
2018-12-03 20:06 ` Slawomir Stepien
2018-12-04 12:43 ` Jonathan Cameron
2018-12-02 11:58 ` [PATCH 2/3] staging: iio: adc: ad7280a: split ad7280_attr_init() " Slawomir Stepien
2018-12-02 15:47 ` Jonathan Cameron
2018-12-02 11:58 ` Slawomir Stepien [this message]
2018-12-02 15:47 ` [PATCH 3/3] staging: iio: adc: ad7280a: add braces to complex for loops Jonathan Cameron
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=20181202115830.20363-4-sst@poczta.fm \
--to=sst@poczta.fm \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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).