Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp578237imc; Sat, 16 Mar 2019 09:16:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxlby7ZGl80C7tiGWJna80lmUb6VWLOmP4oEo1C9ibhtUnj+lD+oQy68Vr9H8RhNAXApE3 X-Received: by 2002:a63:4e4e:: with SMTP id o14mr9278662pgl.254.1552753019104; Sat, 16 Mar 2019 09:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552753019; cv=none; d=google.com; s=arc-20160816; b=DEH3qyBchFXcJkU6WMwSAYdu23nfidlYyGOTLqQwB7x8/f8MVQkgoiXDnNYoG8QkbP OgSRVYU2OWhqPLknDJszSarPmZmu3DJioqmwFHpRAIoMWWVPGcET7HqWKCtVRyVu85ez AxBGDQCDpUMNMjv9czGYoZnABPSXQCSvQAzbqjONlfRwCdo7O4W+q0ew7p9B6abRuSG1 CKt3OSPRte0BE8CwhHrfZiSMiva34HLZ4MEjR7A2a+AV9CGPDb9KGuzn3J4VNaEFkiCH EElzkbgY4mZXPEc9kB33mKhGKs0ssRNROyVapb6BO+C7h53Joscztcv4vpjRlDuPaavD n3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=oFmILUfGbYbqEuZebj4G5xsY5tRhNwJrH8K1kpWb5t4=; b=L4IRjLhHscpS0OguDJK4cF9IS4MbNNIqC7pTIqEB0ZoaG6EQjYn8S9otqrwrLGPBRg lHalEw1rkTx6+s/r81EuVCKFpKXT6fDymcUqY6rDbBXrXJa8SclbYDNJUqyzbjdwnWqu mgqeF6m9FuCb/Ev7dS0apQKikXXgzDbuHMEjUnzaTqm5vjo9EVbq3VbDvFzZeTS0g/gL uYJPuTYvhHKQ100gaT1r8jwXypDMKHVWJXev7ptA0mVg/wJK3VJWbOEwwHxoYBK/3vOT j4z8WOYK1uNQi2dFZJyNpH+Cznmcqqktq7z3ljcSc6fCVF3g30khS0rwqymbrbejmWY+ s4SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si4518984pga.465.2019.03.16.09.16.43; Sat, 16 Mar 2019 09:16:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbfCPQOZ (ORCPT + 99 others); Sat, 16 Mar 2019 12:14:25 -0400 Received: from saturn.retrosnub.co.uk ([46.235.226.198]:45088 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbfCPQOY (ORCPT ); Sat, 16 Mar 2019 12:14:24 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) by saturn.retrosnub.co.uk (Postfix; Retrosnub mail submission) with ESMTPSA id 0296A9E7589; Sat, 16 Mar 2019 16:14:22 +0000 (GMT) Date: Sat, 9 Mar 2019 18:48:09 +0000 From: Jonathan Cameron To: Anderson Reis Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, matt.ranostay@konsulko.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com, Anderson Reis , Lucas Oshiro Subject: Re: [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement Message-ID: <20190309184809.3bbe694a@archlinux> In-Reply-To: <20190309184615.54feca1d@archlinux> References: <20190308194655.5983-1-anderson.reis.rosa@usp.com> <20190308194655.5983-4-anderson.reis.rosa@usp.com> <20190309184615.54feca1d@archlinux> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Mar 2019 18:46:15 +0000 Jonathan Cameron wrote: > On Fri, 8 Mar 2019 16:46:54 -0300 > Anderson Reis 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 > > Signed-off-by: Anderson Reis > 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; >