pcmcia: Guard yenta_dev_{resume,suspend}_noirq() on CONFIG_PM_SLEEP
PATCH 1/1 pcmcia: Guard yenta_dev_{resume,suspend}_noirq() on CONFIG_PM_SLEEP
When building without CONFIG_PM_SLEEP:
drivers/pcmcia/yenta_socket.c:1322:12: error: ‘yenta_dev_resume_noirq’ defined but not used [-Werror=unused-function]
1322 | static int yenta_dev_resume_noirq(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/pcmcia/yenta_socket.c:1303:12: error: ‘yenta_dev_suspend_noirq’ defined but not used [-Werror=unused-function]
1303 | static int yenta_dev_suspend_noirq(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS evaluates to an empty macro when CONFIG_PM_SLEEP is not set. Every callback in yenta_pm_ops depends on CONFIG_PM_SLEEP to work properly so just guard this whole block on CONFIG_PM_SLEEP, rather than CONFIG_PM, which CONFIG_PM_SLEEP will select.
--- drivers/pcmcia/yenta_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pcmcia/yenta_socket.c +1 -1
@@ -1299,7 +1299,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)return ret; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int yenta_dev_suspend_noirq (struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev);
base-commit: fbb3485f1f931102d8ba606f1c28123f5b48afa3
Signature · 1 line
2.34.1
Dominik Brodowski
maintainerAm Tue, Jan 11, 2022 at 09:50:04AM -0700 schrieb Nathan Chancellor:
Quoted 10 lines
When building without
CONFIG_PM_SLEEP:
drivers/pcmcia/yenta_socket.c:1322:12: error: ‘yenta_dev_resume_noirq’ defined but not used [-Werror=unused-function]
1322 | static intyenta_dev_resume_noirq(struct device *dev)| ^~~~~~~~~~~~~~~~~~~~~~ drivers/pcmcia/yenta_socket.c:1303:12: error: ‘yenta_dev_suspend_noirq’ defined but not used [-Werror=unused-function] 1303 | static int yenta_dev_suspend_noirq(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
Quoted 8 lines
SET_NOIRQ_SYSTEM_SLEEP_PM_OPSevaluates to an empty macro whenCONFIG_PM_SLEEPis not set. Every callback inyenta_pm_opsdepends onCONFIG_PM_SLEEPto work properly so just guard this whole block onCONFIG_PM_SLEEP, rather thanCONFIG_PM, whichCONFIG_PM_SLEEPwill select.Fixes 3daaf2c7aae8 ("pcmcia: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()")Signed-off-by Nathan Chancellor <[email protected]>
Thanks! An equivalent patch by Paul E. McKenney was hand-picked by Linus in the meantime:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=579f3a6d32a9c3d1cf5c2b1bd66817a2db31a968
Thanks again,
Dominik
Quoted 22 lines
--- drivers/pcmcia/yenta_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pcmcia/yenta_socket.c +1
-1@@ -1299,7 +1299,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)return ret; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int yenta_dev_suspend_noirq (struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev);base-commit:
fbb3485f1f931102d8ba606f1c28123f5b48afa3Signature · 1 line
2.34.1