scsi: core: ufs-pci: hide unused ufshcd_pci_restore function
PATCH 1/1 scsi: core: ufs-pci: hide unused ufshcd_pci_restore function
From: Arnd Bergmann <[email protected]>
When CONFIG_PM_SLEEP is disabled, ufshcd_pci_restore() fails to compile but is also unused:
drivers/scsi/ufs/ufshcd-pci.c: In function 'ufshcd_pci_restore':drivers/scsi/ufs/ufshcd-pci.c:459:16: error: implicit declaration of function 'ufshcd_system_resume'; did you mean 'ufshcd_runtime_resume'? [-Werror=implicit-function-declaration]
459 | return ufshcd_system_resume(dev);
| ^~~~~~~~~~~~~~~~~~~~
| ufshcd_runtime_resume
At top level:
drivers/scsi/ufs/ufshcd-pci.c:452:12: error: 'ufshcd_pci_restore' defined but not used [-Werror=unused-function]
452 | static int ufshcd_pci_restore(struct device *dev)
| ^~~~~~~~~~~~~~~~~~Enclose it within the same #ifdef as the related code.
--- drivers/scsi/ufs/ufshcd-pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/ufs/ufshcd-pci.c +2 -0
@@ -449,6 +449,7 @@ static struct ufs_hba_variant_ops ufs_intel_lkf_hba_vops = { .device_reset = ufs_intel_device_reset, }; +#ifdef CONFIG_PM_SLEEP static int ufshcd_pci_restore (struct device *dev) {struct ufs_hba *hba =dev_get_drvdata (dev);
@@ -458,6 +459,7 @@ static int ufshcd_pci_restore(struct device *dev) return ufshcd_system_resume(dev); } +#endif /** * ufshcd_pci_shutdown - main function to put the controller in reset state
Signature · 1 line
2.29.2
Quoted 37 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When
CONFIG_PM_SLEEPis disabled,ufshcd_pci_restore()fails to compile but is also unused:
drivers/scsi/ufs/ufshcd-pci.c: In function 'ufshcd_pci_restore':drivers/scsi/ufs/ufshcd-pci.c:459:16: error: implicit declaration of function 'ufshcd_system_resume'; did you mean 'ufshcd_runtime_resume'? [-Werror=implicit-function-declaration]459 | return ufshcd_system_resume(dev); | ^~~~~~~~~~~~~~~~~~~~ | ufshcd_runtime_resume At top level: drivers/scsi/ufs/ufshcd-pci.c:452:12: error: 'ufshcd_pci_restore' defined but not used [-Werror=unused-function] 452 | static int ufshcd_pci_restore(struct device *dev) | ^~~~~~~~~~~~~~~~~~Enclose it within the same #ifdef as the related code.
Fixes 21431d5bdf15 ("scsi: core: ufs-pci: Force a full restore after suspend-to-disk")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/scsi/ufs/ufshcd-pci.c | 2 ++ 1 file changed, 2 insertions(+)drivers/scsi/ufs/ufshcd-pci.c +1
-0@@ -449,6 +449,7 @@ static struct ufs_hba_variant_ops ufs_intel_lkf_hba_vops = { .device_reset = ufs_intel_device_reset, }; +#ifdef CONFIG_PM_SLEEP static int ufshcd_pci_restore (struct device *dev) {struct ufs_hba *hba =dev_get_drvdata (dev);
drivers/scsi/ufs/ufshcd-pci.c static int ufshcd_pci_restore(struct device *dev) · line 465
Quoted 7 lines
drivers/scsi/ufs/ufshcd-pci.c +1
-0@@ -458,6 +459,7 @@ static int ufshcd_pci_restore(struct device *dev) return ufshcd_system_resume(dev); } +#endif /** * ufshcd_pci_shutdown - main function to put the controller in reset state
Quoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When
CONFIG_PM_SLEEPis disabled,ufshcd_pci_restore()fails to compile but is also unused:
drivers/scsi/ufs/ufshcd-pci.c: In function 'ufshcd_pci_restore':drivers/scsi/ufs/ufshcd-pci.c:459:16: error: implicit declaration of function 'ufshcd_system_resume'; did you mean 'ufshcd_runtime_resume'? [-Werror=implicit-function-declaration]459 | return ufshcd_system_resume(dev); | ^~~~~~~~~~~~~~~~~~~~ | ufshcd_runtime_resume At top level: drivers/scsi/ufs/ufshcd-pci.c:452:12: error: 'ufshcd_pci_restore' defined but not used [-Werror=unused-function] 452 | static int ufshcd_pci_restore(struct device *dev) | ^~~~~~~~~~~~~~~~~~
Quoted 4 lines
Enclose it within the same #ifdef as the related code.
Fixes 21431d5bdf15 ("scsi: core: ufs-pci: Force a full restore after suspend-to-disk")Signed-off-by Arnd Bergmann <[email protected]>
There is a fixed version of "scsi: core: ufs-pci: Force a full restore after suspend-to-disk" here:
Quoted 25 lines
--- drivers/scsi/ufs/ufshcd-pci.c | 2 ++ 1 file changed, 2 insertions(+)drivers/scsi/ufs/ufshcd-pci.c +2
-0@@ -449,6 +449,7 @@ static struct ufs_hba_variant_ops ufs_intel_lkf_hba_vops = { .device_reset = ufs_intel_device_reset, }; +#ifdef CONFIG_PM_SLEEP static int ufshcd_pci_restore (struct device *dev) {struct ufs_hba *hba =dev_get_drvdata (dev);@@ -458,6 +459,7 @@ static int ufshcd_pci_restore(struct device *dev) return ufshcd_system_resume(dev); } +#endif /** * ufshcd_pci_shutdown - main function to put the controller in reset state