mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_lightbar - hide unused PM functions
@ 2017-06-27 15:36 Arnd Bergmann
  2017-06-27 16:04 ` Guenter Roeck
  2017-06-27 16:29 ` Benson Leung
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-06-27 15:36 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Arnd Bergmann, Enric Balletbo i Serra, Guenter Roeck, Lee Jones,
	Jonathan Cameron, Benson Leung, Eric Caruso, Gwendal Grignou,
	Vincent Palatin, Jeffery Yu, Logan Gunthorpe, linux-kernel

The only reference to the new functions is inside of an #ifdef,
which now causes a harmless warning when CONFIG_PM_SLEEP is not set:

chrome/cros_ec_dev.c:478:12: error: 'ec_device_resume' defined but not used [-Werror=unused-function]
chrome/cros_ec_dev.c:469:12: error: 'ec_device_suspend' defined but not used [-Werror=unused-function]

This marks the two functions as __maybe_unused so they can get
silently dropped by the compiler.

Fixes: 405c84308c43 ("platform/chrome: cros_ec_lightbar - Control of suspend/resume lightbar sequence")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/chrome/cros_ec_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index b9bf086f7569..cf6c4f0846b8 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -466,7 +466,7 @@ static const struct platform_device_id cros_ec_id[] = {
 };
 MODULE_DEVICE_TABLE(platform, cros_ec_id);
 
-static int ec_device_suspend(struct device *dev)
+static __maybe_unused int ec_device_suspend(struct device *dev)
 {
 	struct cros_ec_dev *ec = dev_get_drvdata(dev);
 
@@ -475,7 +475,7 @@ static int ec_device_suspend(struct device *dev)
 	return 0;
 }
 
-static int ec_device_resume(struct device *dev)
+static __maybe_unused int ec_device_resume(struct device *dev)
 {
 	struct cros_ec_dev *ec = dev_get_drvdata(dev);
 
-- 
2.9.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_lightbar - hide unused PM functions
  2017-06-27 15:36 [PATCH] platform/chrome: cros_ec_lightbar - hide unused PM functions Arnd Bergmann
@ 2017-06-27 16:04 ` Guenter Roeck
  2017-06-27 16:29 ` Benson Leung
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2017-06-27 16:04 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Olof Johansson, Enric Balletbo i Serra, Guenter Roeck, Lee Jones,
	Jonathan Cameron, Benson Leung, Eric Caruso, Gwendal Grignou,
	Vincent Palatin, Jeffery Yu, Logan Gunthorpe, linux-kernel

On Tue, Jun 27, 2017 at 8:36 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> The only reference to the new functions is inside of an #ifdef,
> which now causes a harmless warning when CONFIG_PM_SLEEP is not set:
>
> chrome/cros_ec_dev.c:478:12: error: 'ec_device_resume' defined but not used [-Werror=unused-function]
> chrome/cros_ec_dev.c:469:12: error: 'ec_device_suspend' defined but not used [-Werror=unused-function]
>
> This marks the two functions as __maybe_unused so they can get
> silently dropped by the compiler.
>
> Fixes: 405c84308c43 ("platform/chrome: cros_ec_lightbar - Control of suspend/resume lightbar sequence")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>  drivers/platform/chrome/cros_ec_dev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
> index b9bf086f7569..cf6c4f0846b8 100644
> --- a/drivers/platform/chrome/cros_ec_dev.c
> +++ b/drivers/platform/chrome/cros_ec_dev.c
> @@ -466,7 +466,7 @@ static const struct platform_device_id cros_ec_id[] = {
>  };
>  MODULE_DEVICE_TABLE(platform, cros_ec_id);
>
> -static int ec_device_suspend(struct device *dev)
> +static __maybe_unused int ec_device_suspend(struct device *dev)
>  {
>         struct cros_ec_dev *ec = dev_get_drvdata(dev);
>
> @@ -475,7 +475,7 @@ static int ec_device_suspend(struct device *dev)
>         return 0;
>  }
>
> -static int ec_device_resume(struct device *dev)
> +static __maybe_unused int ec_device_resume(struct device *dev)
>  {
>         struct cros_ec_dev *ec = dev_get_drvdata(dev);
>
> --
> 2.9.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_lightbar - hide unused PM functions
  2017-06-27 15:36 [PATCH] platform/chrome: cros_ec_lightbar - hide unused PM functions Arnd Bergmann
  2017-06-27 16:04 ` Guenter Roeck
@ 2017-06-27 16:29 ` Benson Leung
  1 sibling, 0 replies; 3+ messages in thread
From: Benson Leung @ 2017-06-27 16:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Olof Johansson, Enric Balletbo i Serra, Guenter Roeck, Lee Jones,
	Jonathan Cameron, Benson Leung, Eric Caruso, Gwendal Grignou,
	Vincent Palatin, Jeffery Yu, Logan Gunthorpe, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

Hi Arnd,

On Tue, Jun 27, 2017 at 05:36:36PM +0200, Arnd Bergmann wrote:
> The only reference to the new functions is inside of an #ifdef,
> which now causes a harmless warning when CONFIG_PM_SLEEP is not set:
> 
> chrome/cros_ec_dev.c:478:12: error: 'ec_device_resume' defined but not used [-Werror=unused-function]
> chrome/cros_ec_dev.c:469:12: error: 'ec_device_suspend' defined but not used [-Werror=unused-function]
> 
> This marks the two functions as __maybe_unused so they can get
> silently dropped by the compiler.
> 
> Fixes: 405c84308c43 ("platform/chrome: cros_ec_lightbar - Control of suspend/resume lightbar sequence")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Good catch. Applied. Thanks!
-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-27 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 15:36 [PATCH] platform/chrome: cros_ec_lightbar - hide unused PM functions Arnd Bergmann
2017-06-27 16:04 ` Guenter Roeck
2017-06-27 16:29 ` Benson Leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome