Skip to contentSkip to conversation

mfd: intel-lpss: hide suspend/resume functions in #ifdef

PATCH Applied Arnd Bergmann 2 participants 2 messages May 16, 2023 – May 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: intel-lpss: hide suspend/resume functions in #ifdef

From: Arnd Bergmann <[email protected]>

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.

---
 drivers/mfd/intel-lpss.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mfd/intel-lpss.c +2 -0
index cfbee2cfba6b..9591b354072a 100644
@@ -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)
 {
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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)

Quoted 7 lines

Add the same #ifdef around the definition of the unused functions, which avoids the warning and slightly reduces the code size.

---
 drivers/mfd/intel-lpss.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks

Signature · 1 line
Lee Jones [李琼斯]