Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1516879ima; Sat, 2 Feb 2019 02:15:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ0N2H3XEiTOICYHsWzbVAFgBj+GUVoXrSW0zEFXjeJ9JFA0Vsv3x6TbiMdFGjQTMcFKazY X-Received: by 2002:a63:bd51:: with SMTP id d17mr5756670pgp.443.1549102514346; Sat, 02 Feb 2019 02:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549102514; cv=none; d=google.com; s=arc-20160816; b=l3l0TtteD1hY5MlDF2SJ5hI423VGQwqUSp9byUHwxm27/1hdj05OjDYn5mOa0AUZpZ Z8028HKWbD98lTYkHt897mQ1UYqmhQ1lW8nfO4A2XfiH0HsE2nkrY1WpqX9slxrCBY7F LzifUah/jTJX9Tl2JA/LTwuy3vi6N7Rgnk9fvmi9C31f9v4gEh1CL0fTmBTR6qn76J8g z23bb/uKWPiKoy8xFYs4vfxU1pbFaWUAmfbCpfQ2xBGi2y3ZBgMlAcURfxNC9xXlNDzj O8vN2NjVS0PgBsAG1FGP2bQIE5DnM1ZMFX416DvHYGJnSA2LmXJnarA5ED1Qc7VRf6UK V5Gw== 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 :dkim-signature; bh=F0iK9yP3BumnoFILIOwzOBJmrT3Q2Rhwr47voSlR6Iw=; b=e/FtVp/Y9oAwv2Cid3Z47gXGAv9oaUyPP4pF8txikxaPn2mTYOFKl4d2E6BM5LB7MK BSLXnryr3wi913I501+mFzZS/kCXgWRQSm89WPiEnEZsRu5mukGetoVZdWFOdNik3Onx XUVxs5pIeyhuOjviGC1tvKUGen/Mk/XzMxjqVd71i+OVTdv02TWOu1gReJKgoUCxAD2Z F8LBtDI1zBU/8rtwVLu4ZrjIbHW4pcdigL9U5ihn8fHvmarCH1yCnO+cWqUp1SdwMy5h Y1XcPSxHH+Li2uKajOYq7edZds6FGZ2jZyWOgs35MZep3EaQriNaH0NrRwFm0Gl65HJN KwoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KMLa09a3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2445387ply.409.2019.02.02.02.14.58; Sat, 02 Feb 2019 02:15:14 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=KMLa09a3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727431AbfBBKAv (ORCPT + 99 others); Sat, 2 Feb 2019 05:00:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:50988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbfBBKAv (ORCPT ); Sat, 2 Feb 2019 05:00:51 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F7692084C; Sat, 2 Feb 2019 10:00:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549101650; bh=4Xv75aPPdIsDZA8K4EHTacleU6uyrEHJTd0XYAMasU0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KMLa09a34FEne62cxGLRH24bpAhmCGvSoOQKRUl3SxKNUMyISh38GvD5pZSirnz5J g43DQsxfWlKuFeIiK3zdKQlzrtNrXFZtoZw4qxxvoY8TIlbIiNUvj351ueDyC2uRE+ G/0DtdkwmJG+cj83yCo5sZPYIzT2EJN2dHRqC9l0= Date: Sat, 2 Feb 2019 10:00:44 +0000 From: Jonathan Cameron To: LSO Cc: Joe Perches , 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 Subject: Re: [PATCH] iio:potentiostat:lmp91000: solve codestyle WARNINGs and CHECKs Message-ID: <20190202100044.678a9a9c@archlinux> In-Reply-To: References: <20190129183656.15656-1-lucasseikioshiro@gmail.com> 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 Fri, 1 Feb 2019 12:29:11 -0200 LSO wrote: > Thanks for the review! > > On 29/01/2019 20:48, Joe Perches wrote: > > On Tue, 2019-01-29 at 16:36 -0200, Lucas Oshiro wrote: > >> Solve most of the checkpatch.pl WARNINGs and CHECKs on lmp9100.c. They > >> are the following: > >> > >> lmp91000.c:116: CHECK: Unnecessary parentheses around 'state != channel' > >> lmp91000.c:116: CHECK: Unnecessary parentheses around 'channel == LMP91000_REG_MODECN_TEMP' > >> lmp91000.c:214: CHECK: braces {} should be used on all arms of this statement > >> lmp91000.c:216: CHECK: Unbalanced braces around else statement > >> lmp91000.c:258: WARNING: line over 80 characters > >> lmp91000.c:279: CHECK: Please don't use multiple blank lines > > > > Some will say this is too many things to do at once. > > I think it's mostly fine, but there are a few nits > > that also could use fixing. Always a case of personal judgement. I agree that this one 'just' falls on the side of not too many things for one patch. If there had been a few more items then it would have been too much. I would also have been happy with it broken out. If I had been spinning it myself, I would have done it as 3 patches in pairs from your list above with the last one grouping the white space changes. The test inversion below is also stretching beyond simple style so probably should be broken out. > > > >> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c > > [] > >> @@ -211,9 +211,9 @@ 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")) > >> + if (of_property_read_bool(np, "ti,external-tia-resistor")) { > >> val = 0; > >> - else { > >> + } else { > >> dev_err(dev, "no ti,tia-gain-ohm defined"); > >> return ret; > >> } > > > > This could use inverting the test > > > > if (ret) { > > if (!of_property_read_bool(...)) { > > dev_err(dev, "no ti,ti-gain-ohm defined\n"); > > return ret; > > } > > val = 0; > > } > > > Thanks for the suggestion, I'll do that in the next version. > > > Also the dev_err is missing a '\n' termination > > My aim in this patch was only solve style problems, but I > can put that missing '\n' too. Do you think it could be done > in the same commit or it's a better idea do it in another > commit and send both as a patchset? Separate commit given as you say it's not style and this one has enough different things in it already! Thanks, Jonathan > > > >