* [PATCH 00/14] drivers: use __maybe_unused to hide pm functions
@ 2016-03-02 15:58 Arnd Bergmann
2016-03-02 15:59 ` [PATCH 08/14] scsi: mvumi: " Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2016-03-02 15:58 UTC (permalink / raw)
Cc: linux-arm-kernel, Arnd Bergmann, herbert, k.kozlowski,
dan.j.williams, vinod.koul, baohua, dmitry.torokhov, tglx, jason,
marc.zyngier, laurent.pinchart, mchehab, lee.jones, kvalo,
ludovic.desroches, linus.walleij, sre, dbaryshkov, JBottomley,
martin.petersen, broonie, linux-crypto, linux-samsung-soc,
linux-kernel, dmaengine, linux-input, linux-media, netdev,
linux-wireless, linux-gpio, linux-pm, linux-scsi, alsa-devel
I found many variations of the bug in these device drivers (and some
USB drivers I already send patches for in a separate series).
In each case, the power management operations structure conditionally
references suspend/resume functions, but the functions are hidden
in an incorrect #ifdef or not hidden at all.
We could try to correct the #ifdefs, but it seems easier to just
mark those functions as __maybe_unused, which has the same effect
but provides better compile-time test coverage and (subjectively)
looks a bit nicer.
I have a patch series that avoids all warnings in ARM randconfig
builds, and I have verified that all these patches fix a warning that
is still present in today's linux-next, and that they do not
introduce new warnings in any configuration I found.
Note that all these drivers are ARM specific, so I assume that
all portable drivers got fixed already when someone rand into
the problem on x86.
There are no dependencies between the patches, so I'd appreciate
subsystem maintainers to put them directly into their git trees.
Arnd
Arnd Bergmann (14):
pinctrl: at91: use __maybe_unused to hide pm functions
irqchip: st: use __maybe_unused to hide st_irq_syscfg_resume
power: ipaq-micro-battery: use __maybe_unused to hide pm functions
power: pm2301-charger: use __maybe_unused to hide pm functions
mfd: ipaq-micro: use __maybe_unused to hide pm functions
dma: sirf: use __maybe_unused to hide pm functions
hw_random: exynos: use __maybe_unused to hide pm functions
scsi: mvumi: use __maybe_unused to hide pm functions
amd-xgbe: use __maybe_unused to hide pm functions
wireless: cw1200: use __maybe_unused to hide pm functions_
input: spear-keyboard: use __maybe_unused to hide pm functions
keyboard: snvs-pwrkey: use __maybe_unused to hide pm functions
[media] omap3isp: use IS_ENABLED() to hide pm functions
ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resume
drivers/char/hw_random/exynos-rng.c | 10 ++++------
drivers/dma/sirf-dma.c | 10 ++++------
drivers/input/keyboard/snvs_pwrkey.c | 4 ++--
drivers/input/keyboard/spear-keyboard.c | 6 ++----
drivers/irqchip/irq-st.c | 2 +-
drivers/media/platform/omap3isp/isp.c | 13 +------------
drivers/mfd/ipaq-micro.c | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 6 ++----
drivers/net/wireless/st/cw1200/cw1200_spi.c | 9 ++-------
drivers/net/wireless/st/cw1200/pm.h | 9 +++++++--
drivers/pinctrl/pinctrl-at91-pio4.c | 4 ++--
drivers/power/ipaq_micro_battery.c | 4 ++--
drivers/power/pm2301_charger.c | 22 ++++++----------------
drivers/scsi/mvumi.c | 4 ++--
sound/soc/rockchip/rockchip_spdif.c | 4 ++--
15 files changed, 40 insertions(+), 69 deletions(-)
--
2.7.0
Cc: herbert@gondor.apana.org.au
Cc: k.kozlowski@samsung.com
Cc: dan.j.williams@intel.com
Cc: vinod.koul@intel.com
Cc: baohua@kernel.org
Cc: dmitry.torokhov@gmail.com
Cc: tglx@linutronix.de
Cc: jason@lakedaemon.net
Cc: marc.zyngier@arm.com
Cc: laurent.pinchart@ideasonboard.com
Cc: mchehab@osg.samsung.com
Cc: lee.jones@linaro.org
Cc: kvalo@codeaurora.org
Cc: ludovic.desroches@atmel.com
Cc: linus.walleij@linaro.org
Cc: sre@kernel.org
Cc: dbaryshkov@gmail.com
Cc: JBottomley@odin.com
Cc: martin.petersen@oracle.com
Cc: broonie@kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: dmaengine@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Cc: linux-rockchip@lists.infradead.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 08/14] scsi: mvumi: use __maybe_unused to hide pm functions
2016-03-02 15:58 [PATCH 00/14] drivers: use __maybe_unused to hide pm functions Arnd Bergmann
@ 2016-03-02 15:59 ` Arnd Bergmann
2016-03-03 8:30 ` Johannes Thumshirn
2016-03-05 22:08 ` Martin K. Petersen
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-03-02 15:59 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen
Cc: linux-arm-kernel, Arnd Bergmann, linux-scsi, linux-kernel
The mvumi scsi hides the references to its suspend/resume functions
in an #ifdef but does not hide the implementation the same way:
drivers/scsi/mvumi.c:2632:12: error: 'mvumi_suspend' defined but not used [-Werror=unused-function]
drivers/scsi/mvumi.c:2651:12: error: 'mvumi_resume' defined but not used [-Werror=unused-function]
This adds __maybe_unused annotations so the compiler knows
it can silently drop them instead of warning, while avoiding
the addition of another #ifdef.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/scsi/mvumi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 02360de6b7e0..39285070f3b5 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2629,7 +2629,7 @@ static void mvumi_shutdown(struct pci_dev *pdev)
mvumi_flush_cache(mhba);
}
-static int mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
+static int __maybe_unused mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct mvumi_hba *mhba = NULL;
@@ -2648,7 +2648,7 @@ static int mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
return 0;
}
-static int mvumi_resume(struct pci_dev *pdev)
+static int __maybe_unused mvumi_resume(struct pci_dev *pdev)
{
int ret;
struct mvumi_hba *mhba = NULL;
--
2.7.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 08/14] scsi: mvumi: use __maybe_unused to hide pm functions
2016-03-02 15:59 ` [PATCH 08/14] scsi: mvumi: " Arnd Bergmann
@ 2016-03-03 8:30 ` Johannes Thumshirn
2016-03-05 22:08 ` Martin K. Petersen
1 sibling, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2016-03-03 8:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: James E.J. Bottomley, Martin K. Petersen, linux-arm-kernel,
linux-scsi, linux-kernel
On Wed, Mar 02, 2016 at 04:59:00PM +0100, Arnd Bergmann wrote:
> The mvumi scsi hides the references to its suspend/resume functions
> in an #ifdef but does not hide the implementation the same way:
>
> drivers/scsi/mvumi.c:2632:12: error: 'mvumi_suspend' defined but not used [-Werror=unused-function]
> drivers/scsi/mvumi.c:2651:12: error: 'mvumi_resume' defined but not used [-Werror=unused-function]
>
> This adds __maybe_unused annotations so the compiler knows
> it can silently drop them instead of warning, while avoiding
> the addition of another #ifdef.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 08/14] scsi: mvumi: use __maybe_unused to hide pm functions
2016-03-02 15:59 ` [PATCH 08/14] scsi: mvumi: " Arnd Bergmann
2016-03-03 8:30 ` Johannes Thumshirn
@ 2016-03-05 22:08 ` Martin K. Petersen
1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-03-05 22:08 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Martin K. Petersen, linux-arm-kernel, linux-scsi, linux-kernel,
Johannes Thumshirn
>>>>> "Arnd" == Arnd Bergmann <arnd@arndb.de> writes:
Arnd> The mvumi scsi hides the references to its suspend/resume
Arnd> functions in an #ifdef but does not hide the implementation the
Arnd> same way:
Applied to 4.6/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-05 22:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-02 15:58 [PATCH 00/14] drivers: use __maybe_unused to hide pm functions Arnd Bergmann
2016-03-02 15:59 ` [PATCH 08/14] scsi: mvumi: " Arnd Bergmann
2016-03-03 8:30 ` Johannes Thumshirn
2016-03-05 22:08 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox