Re: [PATCH 2/3] iio: dac: ad5706r: Add support for AD5706R DAC
From: Nuno Sá
Date: Mon Feb 23 2026 - 05:16:47 EST
On Fri, 2026-02-20 at 18:56 +0200, Andy Shevchenko wrote:
> On Fri, Feb 20, 2026 at 03:02:37PM +0000, Nuno Sá wrote:
> > On Fri, 2026-02-20 at 13:00 +0200, Andy Shevchenko wrote:
> > > On Fri, Feb 20, 2026 at 10:48:59AM +0000, Nuno Sá wrote:
> > > > On Fri, 2026-02-20 at 16:02 +0800, Alexis Czezar Torreno wrote:
>
> ...
>
> > > > > +static void ad5706r_debugs_init(struct iio_dev *indio_dev)
> > > > > +{
> > > > > + struct dentry *d = iio_get_debugfs_dentry(indio_dev);
> > > >
> > > > It should have:
> > > >
> > > > if (!IS_ENABLED(CONFIG_DEBUGFS))
> > > > return
> > >
> > > But why? The debugfs is a stub when disabled, nobody should do that
> > > in the cases when the main purpose is not the debugfs code.
> >
> > Because the compiler can then optimize away all of the above code...
>
> How is it different to the code elimination part that is inside in each of
> the below calls?
Clearly none :). For some reason I thought it would matter. Maybe I was mistaken by
some old code that had #ifdef guards on the debug code.
Any ways, I might send some patches cleaning some places where I added the above so
people do not copy it around.
- Nuno Sá
>