Re: [PATCH v4 1/4] staging: iio: adc: ad7816: redefine mode constants to start from 0

From: Jonathan Cameron

Date: Sun Apr 12 2026 - 14:45:48 EST


On Tue, 31 Mar 2026 13:24:50 +0600
"Md. Mahmudul Hasan Mabud" <mdmahmudulhasan1511@xxxxxxxxx> wrote:

> Redefine AD7816_FULL and AD7816_PD constants to start from 0 instead
> of 1. This change is necessary to use these constants as direct
> indices for the mode string array and to align with standard
> indexing in modern sysfs helpers.
>
> Signed-off-by: Md. Mahmudul Hasan Mabud <mdmahmudulhasan1511@xxxxxxxxx>

Hi.

This shows one of the perhaps less well documented bits of kernel process.
Hold off before sending a new version for a while! Dan commented on this
in v3 but after you'd already sent v4.

General rule is wait at least a week between versions unless it's very minor
stuff after the patch set is very stable or you get an explicit request to
repost sooner (I'll do that occasionally at the end of a kernel cycle).

Anyhow, see discussion on v3.

Jonathan


> ---
> drivers/staging/iio/adc/ad7816.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
> index 172acf135..9a2f60b97 100644
> --- a/drivers/staging/iio/adc/ad7816.c
> +++ b/drivers/staging/iio/adc/ad7816.c
> @@ -22,8 +22,9 @@
> /*
> * AD7816 config masks
> */
> -#define AD7816_FULL 0x1
> -#define AD7816_PD 0x2
> +#define AD7816_FULL 0
> +#define AD7816_PD 1
> +
> #define AD7816_CS_MASK 0x7
> #define AD7816_CS_MAX 0x4
>