Re: [PATCH v2 05/14] iio: adc: stm32-adc: rework internal channels data

From: Andy Shevchenko

Date: Thu Sep 24 2026 - 16:53:29 EST


On Wed, Sep 23, 2026 at 05:39:08PM +0200, Fabrice Gasnier wrote:
> Diversity in internal channels data array lead to have zeroed data.
> To facilitate addition of new internal channels, without touching
> all array initializers, only focus on exiting channels on each
> supported ADC variant (e.g. each SoC).
>
> This also allows to get rid of static_assert() checks.
>
> No functional change intended.
> Cosmetic update: remove comma on STM32_ADC_INT_CH_NB as it should
> always be the last element.

Yes, but...

> -static const unsigned int stm32_adc_min_ts_h7[] = { 0, 0, 0, 4300, 9000 };
> -static_assert(ARRAY_SIZE(stm32_adc_min_ts_h7) == STM32_ADC_INT_CH_NB);
> +static const unsigned int stm32_adc_min_ts_h7[STM32_ADC_INT_CH_NB] = {
> + [STM32_ADC_INT_CH_VREFINT] = 4300,
> + [STM32_ADC_INT_CH_VBAT] = 9000

...you should have it when it's not a terminator entry. Here is the case when
it's not a terminator, neither in other similar cases below.

> +};

--
With Best Regards,
Andy Shevchenko