* [PATCH] mfd: intel-lpss: hide suspend/resume functions in #ifdef
@ 2023-05-16 20:27 Arnd Bergmann
2023-05-25 10:31 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-05-16 20:27 UTC (permalink / raw)
To: Lee Jones; +Cc: Arnd Bergmann, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
When CONFIG_PM is disabled, the prototypes for these two functions
are not visible:
drivers/mfd/intel-lpss.c:482:5: error: no previous prototype for 'intel_lpss_suspend' [-Werror=missing-prototypes]
482 | int intel_lpss_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~
drivers/mfd/intel-lpss.c:503:5: error: no previous prototype for 'intel_lpss_resume' [-Werror=missing-prototypes]
503 | int intel_lpss_resume(struct device *dev)
Add the same #ifdef around the definition of the unused functions,
which avoids the warning and slightly reduces the code size.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mfd/intel-lpss.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index cfbee2cfba6b..9591b354072a 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -460,6 +460,7 @@ void intel_lpss_remove(struct device *dev)
}
EXPORT_SYMBOL_GPL(intel_lpss_remove);
+#ifdef CONFIG_PM
static int resume_lpss_device(struct device *dev, void *data)
{
if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND))
@@ -514,6 +515,7 @@ int intel_lpss_resume(struct device *dev)
return 0;
}
EXPORT_SYMBOL_GPL(intel_lpss_resume);
+#endif
static int __init intel_lpss_init(void)
{
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: intel-lpss: hide suspend/resume functions in #ifdef
2023-05-16 20:27 [PATCH] mfd: intel-lpss: hide suspend/resume functions in #ifdef Arnd Bergmann
@ 2023-05-25 10:31 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2023-05-25 10:31 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Arnd Bergmann, linux-kernel
On Tue, 16 May 2023, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> When CONFIG_PM is disabled, the prototypes for these two functions
> are not visible:
>
> drivers/mfd/intel-lpss.c:482:5: error: no previous prototype for 'intel_lpss_suspend' [-Werror=missing-prototypes]
> 482 | int intel_lpss_suspend(struct device *dev)
> | ^~~~~~~~~~~~~~~~~~
> drivers/mfd/intel-lpss.c:503:5: error: no previous prototype for 'intel_lpss_resume' [-Werror=missing-prototypes]
> 503 | int intel_lpss_resume(struct device *dev)
>
> Add the same #ifdef around the definition of the unused functions,
> which avoids the warning and slightly reduces the code size.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/mfd/intel-lpss.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied, thanks
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-25 10:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 20:27 [PATCH] mfd: intel-lpss: hide suspend/resume functions in #ifdef Arnd Bergmann
2023-05-25 10:31 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).