Re: [PATCH v4 2/2] iio: adc: Add TI ADS1100 and ADS1000
From: Andy Shevchenko
Date: Mon Mar 06 2023 - 09:58:55 EST
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