public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Slawomir Stepien <sst@poczta.fm>
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
	pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH 3/3] staging: iio: adc: ad7280a: add braces to complex for loops
Date: Sun, 2 Dec 2018 15:47:48 +0000	[thread overview]
Message-ID: <20181202154748.17100d9a@archlinux> (raw)
In-Reply-To: <20181202115830.20363-4-sst@poczta.fm>

On Sun,  2 Dec 2018 12:58:30 +0100
Slawomir Stepien <sst@poczta.fm> wrote:

> 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>
This is fine.  I'll pick it up when 1 and 2 are updated.

Thanks,

Jonathan

> ---
>  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;
>  


      reply	other threads:[~2018-12-02 15:47 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 ` [PATCH 3/3] staging: iio: adc: ad7280a: add braces to complex for loops Slawomir Stepien
2018-12-02 15:47   ` Jonathan Cameron [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=20181202154748.17100d9a@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sst@poczta.fm \
    /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