Re: [PATCH v3 2/2] iio: dac: dac8163: Add driver for DAC8163

Jonathan Cameron <[email protected]>
Newsgroups org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <20260805004606.7a190728@jic23-huawei>
On Mon, 03 Aug 2026 08:28:51 +0000
"Siratul Islam" <[email protected]> wrote:

> August 2, 2026 at 11:19 PM, "David Lechner" <[email protected]> wrote:
> 
> 
> > 
> > On 8/2/26 11:07 AM, Lukas Metz wrote:  
> ...
> > >  +#define LDAC_CHANNEL_A_MASK BIT(0)
> > >  +#define LDAC_CHANNEL_B_MASK BIT(1)
> > >  +#define VREF_MASK BIT(0)
> > >  +
> > >  +#define DAC8163_INTERNAL_REF_mV 2500
> > >  +#define DAC8163_RES_12_BIT 12
> > >  +#define DAC8163_RES_14_BIT 14
> > >  +#define DAC8163_RES_16_BIT 16
> > >   
> > Macros that just map to a number that is part of the macro name
> > aren't that helpful. We can just use the number directly.
> >   
> Each of them repeats 4 times. I think typing a number that many times 
> is more error prone than having a macro.

These only go into DAC8163_CHAN() as the resolution.
Sure we might end up with 13 due to a typo, but on same
basis the channel numbers might end up as 42 rather than 2
but we don't define a macro for those.

So I agree with David; use the numbers.

Thanks,

Jonathan


> > > 
> > >  
> >  
> 
> --
> Best regards,
> Sirat
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.