Re: [PATCH] gpio: sim: implement the dbg_show() callback

From: Andy Shevchenko
Date: Thu Nov 30 2023 - 08:39:12 EST


On Thu, Nov 30, 2023 at 03:37:48PM +0200, Andy Shevchenko wrote:
> On Thu, Nov 30, 2023 at 11:40:23AM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

...

> > +#else
> > +#define gpio_sim_dbg_show NULL
> > +#endif /* CONFIG_DEBUG_FS */
>
> I;m wondering if you can use PTR_IF() instead of this ugly ifdeffery.

If brave enough, you can even propose a new macro like

#define debugfs_ptr(ptr) ...

(see pm_sleep_ptr() / pm_ptr() as examples).

--
With Best Regards,
Andy Shevchenko