Re: [PATCH v2 1/3] iio: adc: ti-ads1298: Add parentheses around macro parameter

From: Jonathan Cameron

Date: Thu May 07 2026 - 12:29:18 EST


On Thu, 7 May 2026 13:51:26 +0300
Md Shofiqul Islam <shofiqtest@xxxxxxxxx> wrote:

> ADS1298_REG_CHnSET() is missing parentheses around the parameter 'n'.
> Add them to follow kernel macro coding style and prevent potential
> operator precedence issues if the argument is an expression.
>
> Signed-off-by: Md Shofiqul Islam <shofiqtest@xxxxxxxxx>
Hi.

You should have picked up Mike's tag for v2.
Maybe he'll give it again - if not if everything else is fine I'll sort
this out whilst applying.

Thanks,

Jonathan


> ---
> drivers/iio/adc/ti-ads1298.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ti-ads1298.c b/drivers/iio/adc/ti-ads1298.c
> index ae30b47e45..cf5f954206 100644
> --- a/drivers/iio/adc/ti-ads1298.c
> +++ b/drivers/iio/adc/ti-ads1298.c
> @@ -66,7 +66,7 @@
> #define ADS1298_MASK_CONFIG3_VREF_4V BIT(5)
>
> #define ADS1298_REG_LOFF 0x04
> -#define ADS1298_REG_CHnSET(n) (0x05 + n)
> +#define ADS1298_REG_CHnSET(n) (0x05 + (n))
> #define ADS1298_MASK_CH_PD BIT(7)
> #define ADS1298_MASK_CH_PGA GENMASK(6, 4)
> #define ADS1298_MASK_CH_MUX GENMASK(2, 0)