Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Siratul Islam" <siratul.islam@linux.dev>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Lukas Metz" <lukas.metz@gmx.net>, "Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: dac: dac8163: Add driver for DAC8163
Date: Wed, 5 Aug 2026 00:46:06 +0100	[thread overview]
Message-ID: <20260805004606.7a190728@jic23-huawei> (raw)
In-Reply-To: <a967c89f72bc36226dfd35ceba61dc0d2e632ddc@linux.dev>

On Mon, 03 Aug 2026 08:28:51 +0000
"Siratul Islam" <siratul.islam@linux.dev> wrote:

> August 2, 2026 at 11:19 PM, "David Lechner" <dlechner@baylibre.com> 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
> 


      reply	other threads:[~2026-08-04 23:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 16:07 [PATCH v3 0/2] Add driver for DAC8163: Lukas Metz
2026-08-02 16:07 ` [PATCH v3 1/2] dt-bindings: iio: dac: Add DAC8163 Lukas Metz
2026-08-02 16:15   ` sashiko-bot
2026-08-02 16:19   ` David Lechner
2026-08-02 18:55   ` Jonathan Cameron
2026-08-02 16:07 ` [PATCH v3 2/2] iio: dac: dac8163: Add driver for DAC8163 Lukas Metz
2026-08-02 16:18   ` sashiko-bot
2026-08-02 17:19   ` David Lechner
2026-08-02 19:05     ` Jonathan Cameron
2026-08-03  8:28     ` Siratul Islam
2026-08-04 23:46       ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260805004606.7a190728@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.metz@gmx.net \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=siratul.islam@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox