public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: LSO <lucasseikioshiro@gmail.com>
Cc: Joe Perches <joe@perches.com>,
	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] iio:potentiostat:lmp91000: solve codestyle WARNINGs and CHECKs
Date: Sat, 2 Feb 2019 10:00:44 +0000	[thread overview]
Message-ID: <20190202100044.678a9a9c@archlinux> (raw)
In-Reply-To: <d2c70e04-f20c-6847-9740-d883c327c55f@gmail.com>

On Fri, 1 Feb 2019 12:29:11 -0200
LSO <lucasseikioshiro@gmail.com> 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

> > 
> >   


  reply	other threads:[~2019-02-02 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29 18:36 [PATCH] iio:potentiostat:lmp91000: solve codestyle WARNINGs and CHECKs Lucas Oshiro
2019-01-29 22:48 ` Joe Perches
2019-02-01 14:29   ` LSO
2019-02-02 10:00     ` Jonathan Cameron [this message]
2019-02-10  0:05       ` Lucas Oshiro

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=20190202100044.678a9a9c@archlinux \
    --to=jic23@kernel.org \
    --cc=andersonreisrosa@gmail.com \
    --cc=joe@perches.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