platform/surface: mark PM functions as __maybe_unused
Subsystems (3)
PATCH 1/1 platform/surface: mark PM functions as __maybe_unused
From: Arnd Bergmann <[email protected]>
When CONFIG_PM is disabled, the compiler produces harmless warnings:
drivers/platform/surface/surface_gpe.c:184:12: error: unused function 'surface_gpe_suspend' [-Werror,-Wunused-function] static int surface_gpe_suspend(struct device *dev)drivers/platform/surface/surface_gpe.c:189:12: error: unused function 'surface_gpe_resume' [-Werror,-Wunused-function] static int surface_gpe_resume(struct device *dev)
Mark these as __maybe_unused to shut up the warning.
--- drivers/platform/surface/surface_gpe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/surface/surface_gpe.c +2 -2
@@ -181,12 +181,12 @@ static int surface_lid_enable_wakeup(struct device *dev, bool enable)return 0 ; } -static int surface_gpe_suspend (struct device *dev) +static int __maybe_unused surface_gpe_suspend (struct device *dev) {return surface_lid_enable_wakeup (dev, true); } -static int surface_gpe_resume (struct device *dev) +static int __maybe_unused surface_gpe_resume (struct device *dev) {return surface_lid_enable_wakeup (dev, false); }
Signature · 1 line
2.29.2
Maximilian Luz
maintainerQuoted 27 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When
CONFIG_PMis disabled, the compiler produces harmless warnings:
drivers/platform/surface/surface_gpe.c:184:12: error: unused function 'surface_gpe_suspend' [-Werror,-Wunused-function] static intsurface_gpe_suspend(struct device *dev)drivers/platform/surface/surface_gpe.c:189:12: error: unused function 'surface_gpe_resume' [-Werror,-Wunused-function] static intsurface_gpe_resume(struct device *dev)Mark these as
__maybe_unusedto shut up the warning.Fixes 274335f1c557 ("platform/surface: Add Driver to set up lid GPEs on MS Surface device")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/platform/surface/surface_gpe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/platform/surface/surface_gpe.c +0
-1@@ -181,12 +181,12 @@ static int surface_lid_enable_wakeup(struct device *dev, bool enable)return 0 ; } -static int surface_gpe_suspend (struct device *dev)
drivers/platform/surface/surface_gpe.c static int surface_lid_enable_wakeup(struct device *dev, bool enable) · line 192
Quoted 10 lines
drivers/platform/surface/surface_gpe.c +2
-1+static int __maybe_unused surface_gpe_suspend (struct device *dev) {return surface_lid_enable_wakeup (dev, true); } -static int surface_gpe_resume (struct device *dev) +static int __maybe_unused surface_gpe_resume (struct device *dev) {return surface_lid_enable_wakeup (dev, false); }
Hi,
a patch doing this exact thing has already been submitted, but has yet to be picked up:
https://www.spinics.net/lists/platform-driver-x86/msg23888.html
Thanks,
Max