OSDN Git Service

wireless: cw1200: use __maybe_unused to hide pm functions_
authorArnd Bergmann <arnd@arndb.de>
Wed, 2 Mar 2016 15:59:02 +0000 (16:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:03:50 +0000 (11:03 +0100)
commitd3843789e778f93147b719ccf91e2aeea15b59fc
treefefeb7e16f8f9d6a32ce206395032aaf682ec88a
parent6420c014ed9c9f34ea0b0dd9889f7deb55aeba5b
wireless: cw1200: use __maybe_unused to hide pm functions_

commit 836856e3bd61d0644e5178a2c1b51d90459e2788 upstream.

The cw1200 uses #ifdef to check for CONFIG_PM, but then
uses SIMPLE_DEV_PM_OPS, which leaves the references out when
CONFIG_PM_SLEEP is not defined, so we get a warning with
PM=y && PM_SLEEP=n:

drivers/net/wireless/st/cw1200/cw1200_spi.c:450:12: error: 'cw1200_spi_suspend' defined but not used [-Werror=unused-function]

This removes the incorrect #ifdef and instead uses a __maybe_unused
annotation to let the compiler know it can silently drop
the function definition.

For the DEV_PM_OPS definition, we can use an IS_ENABLED() check
to avoid defining the structure when CONFIG_PM is not set without
the #ifdef.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/cw1200/cw1200_spi.c
drivers/net/wireless/cw1200/pm.h