* [PATCH] platform/surface: mark PM functions as __maybe_unused
@ 2021-01-03 14:04 Arnd Bergmann
2021-01-03 15:33 ` Maximilian Luz
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-01-03 14:04 UTC (permalink / raw)
To: Maximilian Luz, Hans de Goede, Mark Gross
Cc: Arnd Bergmann, platform-driver-x86, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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.
Fixes: 274335f1c557 ("platform/surface: Add Driver to set up lid GPEs on MS Surface device")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/platform/surface/surface_gpe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/surface/surface_gpe.c b/drivers/platform/surface/surface_gpe.c
index e49e5d6d5d4e..86f6991b1215 100644
--- a/drivers/platform/surface/surface_gpe.c
+++ b/drivers/platform/surface/surface_gpe.c
@@ -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);
}
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] platform/surface: mark PM functions as __maybe_unused
2021-01-03 14:04 [PATCH] platform/surface: mark PM functions as __maybe_unused Arnd Bergmann
@ 2021-01-03 15:33 ` Maximilian Luz
0 siblings, 0 replies; 2+ messages in thread
From: Maximilian Luz @ 2021-01-03 15:33 UTC (permalink / raw)
To: Arnd Bergmann, Hans de Goede, Mark Gross
Cc: Arnd Bergmann, platform-driver-x86, linux-kernel
On 1/3/21 3:04 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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.
>
> Fixes: 274335f1c557 ("platform/surface: Add Driver to set up lid GPEs on MS Surface device")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/platform/surface/surface_gpe.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/surface/surface_gpe.c b/drivers/platform/surface/surface_gpe.c
> index e49e5d6d5d4e..86f6991b1215 100644
> --- a/drivers/platform/surface/surface_gpe.c
> +++ b/drivers/platform/surface/surface_gpe.c
> @@ -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);
> }
>
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-03 15:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 14:04 [PATCH] platform/surface: mark PM functions as __maybe_unused Arnd Bergmann
2021-01-03 15:33 ` Maximilian Luz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.