diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-05-10 11:21:25 +0200 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2017-07-17 10:27:40 +0530 |
commit | c4b38578aa125763cf5912cc251df0b8ab857071 (patch) | |
tree | e4c8712a40814fb4054307fcff0cdbcbff4ab594 | |
parent | 60acaffcb933cb7b2347ee2d4a078db63d3c2bf1 (diff) | |
download | linaro-android-c4b38578aa125763cf5912cc251df0b8ab857071.tar.gz |
ANDROID: rfkill: fix unused function warning
As reported by kernelci, we get a harmless warning in this driver
when CONFIG_PM is disabled:
net/rfkill/core.c:810:12: warning: 'rfkill_resume' defined but not used [-Wunused-function]
net/rfkill/core.c:800:12: warning: 'rfkill_suspend' defined but not used [-Wunused-function]
This marks the functions as __maybe_unused to remove the #ifdef, and uses
a conditional reference to the pm operations instead, which will work
in any combination.
The patch is needed for both android-common-4.9 and 4.4.
Link: https://kernelci.org/build/id/59117c2f59b5147b06b12d54/logs/
Fixes: de6f7210e931 ("ANDROID: rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down")
Cc: Nick Pelly <npelly@google.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-rw-r--r-- | net/rfkill/core.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 9ef00adbd52e..d223a86e9778 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -854,8 +854,7 @@ void rfkill_resume_polling(struct rfkill *rfkill) } EXPORT_SYMBOL(rfkill_resume_polling); -#ifdef CONFIG_RFKILL_PM -static int rfkill_suspend(struct device *dev) +static __maybe_unused int rfkill_suspend(struct device *dev) { struct rfkill *rfkill = to_rfkill(dev); @@ -865,7 +864,7 @@ static int rfkill_suspend(struct device *dev) return 0; } -static int rfkill_resume(struct device *dev) +static __maybe_unused int rfkill_resume(struct device *dev) { struct rfkill *rfkill = to_rfkill(dev); bool cur; @@ -885,19 +884,13 @@ static int rfkill_resume(struct device *dev) } static SIMPLE_DEV_PM_OPS(rfkill_pm_ops, rfkill_suspend, rfkill_resume); -#define RFKILL_PM_OPS (&rfkill_pm_ops) -#else -#define RFKILL_PM_OPS NULL -#endif static struct class rfkill_class = { .name = "rfkill", .dev_release = rfkill_release, .dev_groups = rfkill_dev_groups, .dev_uevent = rfkill_dev_uevent, -#ifdef CONFIG_RFKILL_PM - .pm = RFKILL_PM_OPS, -#endif + .pm = IS_ENABLED(CONFIG_RFKILL_PM) ? &rfkill_pm_ops : NULL, }; bool rfkill_blocked(struct rfkill *rfkill) |