OSDN Git Service

ANDROID: rfkill: fix unused function warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 10 May 2017 09:21:25 +0000 (11:21 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 12 May 2017 12:41:44 +0000 (14:41 +0200)
commitfaad2b874feaca00465997ec56bbd67ad26c3d15
treec6cdd913b159d6fa583b7dd19f41af42a4be43ae
parentf117eaf0a3193aef0e1eb66e08f5e224b61f1c6d
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>
net/rfkill/core.c