Re: [PATCH v2 1/6] mmc: sdhci: Use EXPORT_PM_FN_NS_GPL() for exporting PM functions
From: Andy Shevchenko
Date: Thu Jan 16 2025 - 10:15:03 EST
On Mon, Dec 09, 2024 at 07:11:41PM +0200, Adrian Hunter wrote:
> On 9/12/24 18:36, Andy Shevchenko wrote:
> > On Mon, Dec 09, 2024 at 12:38:59PM +0200, Adrian Hunter wrote:
> >> On 1/11/24 12:11, Andy Shevchenko wrote:
> >>> Switch from ugly ifdeffery to using EXPORT_PM_FN_NS_GPL()
> >>> for exporting PM functions. This helps cleaning up the other
> >>> SDHCI drivers in the future.
> >>
> >> It seems sdhci is the first code in the kernel to use
> >> EXPORT_PM_FN_NS_GPL() but it was not asked for ;-)
> >>
> >> As such, can you fill in a little background. I am not
> >> sure what it achieves. Why have CONFIG_PM if not to
> >> #ifdef dependent code behind it?
> >
> > It makes sure that the code elimination happens at compile time and
>
> Does it eliminate the code? Maybe I am missing something,
> but it looks like it is still there:
Hmm... Indeed. My tests show the same. I believe these new macros were never
tested (and we have no users in the kernel).
Richard?
> > at the same time gives developer less uglified (by ifdeffery) code.
> > It means there is less risk to miss anything of that which make become
> > a compile-time warning of unused function, or even issues during linking
> > with modules, etc.
> >
> > Should I update a commit message with that?
--
With Best Regards,
Andy Shevchenko