[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZAX/lGR9srDRIzl7@smile.fi.intel.com>
Date: Mon, 6 Mar 2023 16:58:28 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Mike Looijmans <mike.looijmans@...ic.nl>
Cc: devicetree@...r.kernel.org, linux-iio@...r.kernel.org,
Caleb Connolly <caleb.connolly@...aro.org>,
ChiYuan Huang <cy_huang@...htek.com>,
ChiaEn Wu <chiaen_wu@...htek.com>,
Cosmin Tanislav <demonsingur@...il.com>,
Ibrahim Tilki <Ibrahim.Tilki@...log.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Marcus Folkesson <marcus.folkesson@...il.com>,
Ramona Bolboaca <ramona.bolboaca@...log.com>,
William Breathitt Gray <william.gray@...aro.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] iio: adc: Add TI ADS1100 and ADS1000
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
Powered by blists - more mailing lists