Re: [PATCH 4/6] iio: adc: ti-ads1015: Deduplicate channel macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 10, 2022 at 01:34:00AM +0100, Marek Vasut wrote:
> These macros differ only in the number of valid bits of each ADC sample
> and the shift of those bits, i.e. ADS1015 is 12bit ADC shifted by 4 left,
> ADS1115 is 16bit ADC shifted by 0. No functional change.

> Signed-off-by: Marek Vasut <marex@xxxxxxx>

...

> Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Cc: Daniel Baluta <daniel.baluta@xxxxxxx>
> Cc: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

You may consider using --cc parameter in `git send-email` to avoid this noise
in the commit messages.

...

> -		.realbits = 12,					\
> +		.realbits = (_realbits),			\
>  		.storagebits = 16,				\

This seems inconsistent a bit. What if the next chip wants to have more than
16 bits in realbits?

...

> -		.realbits = 16,					\
> +		.realbits = (_realbits),			\
>  		.storagebits = 16,				\

Ditto.

I see two options:
1) add static assert to make sure realbits <= storagebits;
2) make it also configurable.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux