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

Marek Vasut
2022-03-11T11:33:57Z

On 3/11/22 12:29, Andy Shevchenko wrote:
> On Fri, Mar 11, 2022 at 1:55 AM Marek Vasut <marex@denx.de> wrote:
>> On 3/10/22 15:25, Andy Shevchenko wrote:
>>> On Thu, Mar 10, 2022 at 01:34:00AM +0100, Marek Vasut wrote:
>
> ...
>
>>>> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>>> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
>>>> Cc: Daniel Baluta <daniel.baluta@nxp.com>
>>>> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>
>>> You may consider using --cc parameter in `git send-email` to avoid this noise
>>> in the commit messages.
>>
>> This is deliberate so I can keep track of who to CC on which patch.
>
> You may add the Link tag to lore (which `b4` tool can do
> automatically), so you can always access the email from the archives
> and track this down. No need to have this in each of the commit
> messages.

This is used by git-send-email to put the right people on Cc, not by Lore.

> ...
>
>>>> - .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?
>>
>> When such a chip exists, this can be parametrized as well.
>
> Yes, My point is that it's error prone.

Won't IIO core warn if realbits > storagebits ?

> ...
>
>>> I see two options:
>>> 1) add static assert to make sure realbits <= storagebits;
>>
>> Does static_assert work in array of structures (I don't think it does) ?
>
> You can check, but IIRC some of the macros have it. Don't remember the
> details, though.

I already checked before replying, hence my question, as I didn't find a
way to make it work.