From: Adrian Hunter <adrian.hunter@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Victor Shih <victor.shih@genesyslogic.com.tw>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Linux PM list <linux-pm@vger.kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v2 1/6] mmc: sdhci: Use EXPORT_PM_FN_NS_GPL() for exporting PM functions
Date: Mon, 9 Dec 2024 19:11:41 +0200 [thread overview]
Message-ID: <4ee01e24-176e-46ac-9ecd-a0976490cbdc@intel.com> (raw)
In-Reply-To: <Z1ccjxyxO0NMNbkm@smile.fi.intel.com>
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:
$ grep CONFIG_PM .config
# CONFIG_PM is not set
# CONFIG_PMIC_OPREGION is not set
# CONFIG_PMBUS is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_PMIC_DA903X is not set
CONFIG_PM_DEVFREQ=y
# CONFIG_PM_DEVFREQ_EVENT is not set
CONFIG_PM_OPP=y
$ objdump -d drivers/mmc/host/sdhci.ko | grep sdhci_suspend_host
00000000000089f0 <__pfx_sdhci_suspend_host>:
0000000000008a00 <sdhci_suspend_host>:
8a16: e8 00 00 00 00 call 8a1b <sdhci_suspend_host+0x1b>
8a29: 74 0c je 8a37 <sdhci_suspend_host+0x37>
8a35: 75 54 jne 8a8b <sdhci_suspend_host+0x8b>
8a4c: 0f 85 06 01 00 00 jne 8b58 <sdhci_suspend_host+0x158>
8a66: 0f 85 00 01 00 00 jne 8b6c <sdhci_suspend_host+0x16c>
8a7b: e8 00 00 00 00 call 8a80 <sdhci_suspend_host+0x80>
8a86: e9 00 00 00 00 jmp 8a8b <sdhci_suspend_host+0x8b>
8a92: 75 0a jne 8a9e <sdhci_suspend_host+0x9e>
8a98: 0f 84 87 00 00 00 je 8b25 <sdhci_suspend_host+0x125>
8aa5: 74 90 je 8a37 <sdhci_suspend_host+0x37>
8ab8: 0f 85 f5 00 00 00 jne 8bb3 <sdhci_suspend_host+0x1b3>
8ad8: 0f 85 c0 00 00 00 jne 8b9e <sdhci_suspend_host+0x19e>
8af0: 0f 85 93 00 00 00 jne 8b89 <sdhci_suspend_host+0x189>
8b06: e8 00 00 00 00 call 8b0b <sdhci_suspend_host+0x10b>
8b14: 0f 85 1d ff ff ff jne 8a37 <sdhci_suspend_host+0x37>
8b20: e9 00 00 00 00 jmp 8b25 <sdhci_suspend_host+0x125>
8b25: e8 00 00 00 00 call 8b2a <sdhci_suspend_host+0x12a>
8b2c: 75 52 jne 8b80 <sdhci_suspend_host+0x180>
8b53: e9 55 ff ff ff jmp 8aad <sdhci_suspend_host+0xad>
8b62: e8 00 00 00 00 call 8b67 <sdhci_suspend_host+0x167>
8b67: e9 ef fe ff ff jmp 8a5b <sdhci_suspend_host+0x5b>
8b76: e8 00 00 00 00 call 8b7b <sdhci_suspend_host+0x17b>
8b7b: e9 f5 fe ff ff jmp 8a75 <sdhci_suspend_host+0x75>
8b84: e9 15 ff ff ff jmp 8a9e <sdhci_suspend_host+0x9e>
8b94: e8 00 00 00 00 call 8b99 <sdhci_suspend_host+0x199>
8b99: e9 60 ff ff ff jmp 8afe <sdhci_suspend_host+0xfe>
8ba9: e8 00 00 00 00 call 8bae <sdhci_suspend_host+0x1ae>
8bae: e9 32 ff ff ff jmp 8ae5 <sdhci_suspend_host+0xe5>
8bbb: e8 00 00 00 00 call 8bc0 <sdhci_suspend_host+0x1c0>
8bc0: e9 03 ff ff ff jmp 8ac8 <sdhci_suspend_host+0xc8>
$
> 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?
next prev parent reply other threads:[~2024-12-09 17:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 10:11 [PATCH v2 0/6] mmc: sdhci-acpi: A few cleanups Andy Shevchenko
2024-11-01 10:11 ` [PATCH v2 1/6] mmc: sdhci: Use EXPORT_PM_FN_NS_GPL() for exporting PM functions Andy Shevchenko
2024-12-09 10:38 ` Adrian Hunter
2024-12-09 16:36 ` Andy Shevchenko
2024-12-09 17:11 ` Adrian Hunter [this message]
2025-01-16 15:14 ` Andy Shevchenko
2025-01-16 16:55 ` Richard Fitzgerald
2024-11-01 10:11 ` [PATCH v2 2/6] mmc: sdhci-acpi: Switch to SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() and pm_ptr() Andy Shevchenko
2024-12-09 11:00 ` Adrian Hunter
2024-11-01 10:11 ` [PATCH v2 3/6] mmc: sdhci-acpi: Remove not so useful error message Andy Shevchenko
2024-12-09 11:05 ` Adrian Hunter
2024-11-01 10:11 ` [PATCH v2 4/6] mmc: sdhci-acpi: Use devm_platform_ioremap_resource() Andy Shevchenko
2024-12-09 11:26 ` Adrian Hunter
2024-11-01 10:11 ` [PATCH v2 5/6] mmc: sdhci-acpi: Tidy up ACPI ID table Andy Shevchenko
2024-12-09 11:29 ` Adrian Hunter
2024-12-09 16:40 ` Andy Shevchenko
2025-01-16 15:16 ` Andy Shevchenko
2024-11-01 10:11 ` [PATCH v2 6/6] mmc: sdhci-acpi: Don't use "proxy" headers Andy Shevchenko
2024-12-09 11:32 ` Adrian Hunter
2024-12-09 16:43 ` Andy Shevchenko
2024-12-02 15:24 ` [PATCH v2 0/6] mmc: sdhci-acpi: A few cleanups Ulf Hansson
2024-12-02 15:31 ` Andy Shevchenko
2024-12-18 15:55 ` Ulf Hansson
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=4ee01e24-176e-46ac-9ecd-a0976490cbdc@intel.com \
--to=adrian.hunter@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=victor.shih@genesyslogic.com.tw \
/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