lkml.org 
[lkml]   [2019]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement
On Sat, 9 Mar 2019 18:46:15 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Fri, 8 Mar 2019 16:46:54 -0300
> Anderson Reis <andersonreisrosa@gmail.com> wrote:
>
> > Invert if statement arms in line 214, in order to make the code cleaner,
> > solve these checkpatch.pl CHECKs:
> >
> > - lmp9100.c:214: CHECK: braces {} should be used on all arms of this statement
> > - lmp9100.c:216: CHECK: Unbalanced braces around else statement
> >
> > Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> > Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
> Applied.
>
> Thanks,
>
> 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 c45cfb632649..1de17924e154 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"))
Spoke too soon. You didn't build test this. Missing {

Fixed up.

Jonathan

> > dev_err(dev, "no ti,tia-gain-ohm defined");
> > return ret;
> > }
> > + val = 0;
> > }
> >
> > ret = -EINVAL;
>

\
 
 \ /
  Last update: 2019-03-16 17:15    [W:0.039 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site