Re: [PATCH v1 1/1] iio: core: Split debugfs routines

From: Andy Shevchenko

Date: Tue Nov 24 2026 - 05:51:24 EST


On Tue, Nov 24, 2026 at 12:46:22PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 24, 2026 at 11:17:01AM +0100, Joshua Crofts wrote:
> > On 24-Nov-26 10:44, Andy Shevchenko wrote:

...

> > > +#if defined(CONFIG_DEBUG_FS)
> >
> > Veeery small nit, but why not #ifdef CONFIG_DEBUG_FS? It's not
> > as if you're checking for multiple defines.
>
> Or even IS_ENABLED()? Let me check if we have a precedent in IIO, I will use
> then the same or most used style.

FWIW, iio core uses exactly this form for DEBUG_FS test, so for the consistency
I leave it as it, and if required we can fix this later.

$ git grep -n '^#if.*DEBUG' -- drivers/iio/ include/linux/iio/
drivers/iio/gyro/adis16136.c:66:#ifdef CONFIG_DEBUG_FS
drivers/iio/humidity/dht11.c:87:#ifdef CONFIG_DYNAMIC_DEBUG
drivers/iio/humidity/dht11.c:235:#ifdef CONFIG_DYNAMIC_DEBUG
drivers/iio/iio_core.h:19:#if defined(CONFIG_DEBUG_FS)
drivers/iio/imu/adis.c:227:#ifdef CONFIG_DEBUG_FS
include/linux/iio/iio-opaque.h:73:#if defined(CONFIG_DEBUG_FS)
include/linux/iio/iio.h:1010:#if defined(CONFIG_DEBUG_FS)
include/linux/iio/imu/adis.h:573:#ifdef CONFIG_DEBUG_FS

...

> > Static here but not in the header file. Same goes for register_debugfs().
>
> Oh, how does it compile?

Will be fixed in v2. I'll wait a bit and send an update tomorrow.

--
With Best Regards,
Andy Shevchenko