public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
	Caleb Connolly <caleb.connolly@linaro.org>,
	ChiYuan Huang <cy_huang@richtek.com>,
	ChiaEn Wu <chiaen_wu@richtek.com>,
	Cosmin Tanislav <demonsingur@gmail.com>,
	Ibrahim Tilki <Ibrahim.Tilki@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Marcus Folkesson <marcus.folkesson@gmail.com>,
	Ramona Bolboaca <ramona.bolboaca@analog.com>,
	William Breathitt Gray <william.gray@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: adc: Add TI ADS1100 and ADS1000
Date: Mon, 6 Mar 2023 16:58:28 +0200	[thread overview]
Message-ID: <ZAX/lGR9srDRIzl7@smile.fi.intel.com> (raw)
In-Reply-To: <8a1dc110-97fe-a9c8-ce53-918f403a16eb@topic.nl>

On Mon, Mar 06, 2023 at 03:44:23PM +0100, Mike Looijmans wrote:
> On 06-03-2023 14:29, Andy Shevchenko wrote:

...

> Combining it all, I'd arrive at this code:
> 
>     gain = DIV_ROUNDUP_CLOSEST(microvolts, BIT(15)) * MILLI / val2;
>     if (gain < BIT(0) || gain > BIT(3))
>         return -EINVAL;
> 
>     ads1100_set_config_bits(data, ADS1100_PGA_MASK, ffs(gain) - 1);

Fine by me.

...

> > > +			return ads1100_set_config_bits(
> > > +					data, ADS1100_DR_MASK,
> > > +					FIELD_PREP(ADS1100_DR_MASK, i));
> > Wrong indentation.
> > Please, check all your code for this kind of issues.
> > 
> I always run it through checkpatch.pl but that didn't report on this
> indentation.

Checkpatch is:

1) not comprehensive;
2) not must-to-follow;

tool.

Use your common sense. You have a lot of room on the previous line at least
for 'data'. Trailing opening ( is not good indentation. But sometimes might
be unavoidable.

> A bit of digging in the scripts directory yields "Lindent". Feeding my file
> to that indeed changes those lines (and some others too). I'll run my next
> patch through that.

If it will look nice, why not?

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2023-03-06 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.fd3967b4-1646-4b17-a426-66ee84660804@emailsignatures365.codetwo.com>
2023-03-06 13:13 ` [PATCH v4 1/2] dt-bindings: iio: adc: Add TI ADS1100 and ADS1000 Mike Looijmans
2023-03-06 13:13   ` [PATCH v4 2/2] " Mike Looijmans
2023-03-06 13:29     ` Andy Shevchenko
2023-03-06 14:44       ` Mike Looijmans
2023-03-06 14:58         ` Andy Shevchenko [this message]

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=ZAX/lGR9srDRIzl7@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Ibrahim.Tilki@analog.com \
    --cc=caleb.connolly@linaro.org \
    --cc=chiaen_wu@richtek.com \
    --cc=cy_huang@richtek.com \
    --cc=demonsingur@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcus.folkesson@gmail.com \
    --cc=mike.looijmans@topic.nl \
    --cc=ramona.bolboaca@analog.com \
    --cc=william.gray@linaro.org \
    /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