Thread (26 messages) 26 messages, 4 authors, 4d ago

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

From: Andy Shevchenko <hidden>
Date: 2026-09-24 20:53:29
Also in: linux-arm-kernel, linux-iio, lkml

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...
quoted hunk ↗ jump to hunk
-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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help