linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lucas Oshiro <lucasseikioshiro@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-usp@googlegroups.com,
	Anderson Reis <andersonreisrosa@gmail.com>
Subject: Re: [PATCH 4/5] iio:potentiostat:lmp91000: invert if statement
Date: Wed, 20 Feb 2019 09:52:19 +0000	[thread overview]
Message-ID: <20190220095219.2f1efa85@archlinux> (raw)
In-Reply-To: <20190218172236.7781-5-lucasseikioshiro@gmail.com>

On Mon, 18 Feb 2019 14:22:35 -0300
Lucas Oshiro <lucasseikioshiro@gmail.com> wrote:

> Invert if statement arms in line 214, in order to make the code cleaner
> 
> Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>

Given this undoes one of the earlier changes, please merge them.

Jonathan

> ---
>  drivers/iio/potentiostat/lmp91000.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> index 6dba26121a62..7229ef59590a 100644
> --- a/drivers/iio/potentiostat/lmp91000.c
> +++ b/drivers/iio/potentiostat/lmp91000.c
> @@ -211,12 +211,11 @@ static int lmp91000_read_config(struct lmp91000_data *data)
>  
>  	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
>  	if (ret) {
> -		if (of_property_read_bool(np, "ti,external-tia-resistor")) {
> -			val = 0;
> -		} else {
> +		if (!of_property_read_bool(np, "ti,external-tia-resistor")) {
>  			dev_err(dev, "no ti,tia-gain-ohm defined");
>  			return ret;
>  		}
> +		val = 0;
>  	}
>  
>  	ret = -EINVAL;


  reply	other threads:[~2019-02-20  9:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 17:22 [PATCH 0/5] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes Lucas Oshiro
2019-02-18 17:22 ` [PATCH 1/5] iio:potentiostat:lmp91000: remove unnecessary parentheses Lucas Oshiro
2019-02-18 17:22 ` [PATCH 2/5] iio:potentiostat:lmp91000: insert braces around if arms Lucas Oshiro
2019-02-18 17:22 ` [PATCH 3/5] iio:potentiostat:lmp91000: reduce line width and remove blank line Lucas Oshiro
2019-02-18 17:22 ` [PATCH 4/5] iio:potentiostat:lmp91000: invert if statement Lucas Oshiro
2019-02-20  9:52   ` Jonathan Cameron [this message]
2019-02-18 17:22 ` [PATCH 5/5] iio:potentiostat:lmp91000: add '\n' on dev_err Lucas Oshiro
2019-02-18 21:01   ` Joe Perches
2019-02-20  9:49     ` Jonathan Cameron
2019-02-20 22:22       ` Joe Perches
2019-02-26 20:15         ` Lucas Oshiro
2019-03-03 16:49           ` Jonathan Cameron
2019-02-20  9:41 ` [PATCH 0/5] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes 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=20190220095219.2f1efa85@archlinux \
    --to=jic23@kernel.org \
    --cc=andersonreisrosa@gmail.com \
    --cc=kernel-usp@googlegroups.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucasseikioshiro@gmail.com \
    --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).