* [PATCH] PCI: fix unused pci_restore_standard_config without suspend/hibernate
@ 2022-04-20 14:11 Krzysztof Kozlowski
2022-04-20 15:58 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-20 14:11 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Arnd Bergmann, Krzysztof Kozlowski
The pci_restore_standard_config() is called only by functions within
CONFIG_SUSPEND or CONFIG_HIBERNATION, so a configuration with only PM
leads to a warning:
drivers/pci/pci-driver.c:533:12: error: ‘pci_restore_standard_config’ defined but not used [-Werror=unused-function]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/pci/pci-driver.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index dc18c1faf5e5..a2e6aabfa324 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -522,9 +522,9 @@ static void pci_device_shutdown(struct device *dev)
pci_clear_master(pci_dev);
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
-/* Auxiliary functions used for system resume and run-time resume. */
+/* Auxiliary functions used for system resume. */
/**
* pci_restore_standard_config - restore standard config registers of PCI device
@@ -544,6 +544,11 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev)
pci_pme_restore(pci_dev);
return 0;
}
+#endif /* CONFIG_PM_SLEEP */
+
+#ifdef CONFIG_PM
+
+/* Auxiliary functions used for system resume and run-time resume. */
static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
@@ -558,8 +563,7 @@ static void pci_pm_default_resume_early(struct pci_dev *pci_dev)
pci_restore_state(pci_dev);
pci_pme_restore(pci_dev);
}
-
-#endif
+#endif /* CONFIG_PM */
#ifdef CONFIG_PM_SLEEP
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: fix unused pci_restore_standard_config without suspend/hibernate
2022-04-20 14:11 [PATCH] PCI: fix unused pci_restore_standard_config without suspend/hibernate Krzysztof Kozlowski
@ 2022-04-20 15:58 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2022-04-20 15:58 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Arnd Bergmann
On Wed, Apr 20, 2022 at 04:11:35PM +0200, Krzysztof Kozlowski wrote:
> The pci_restore_standard_config() is called only by functions within
> CONFIG_SUSPEND or CONFIG_HIBERNATION, so a configuration with only PM
> leads to a warning:
>
> drivers/pci/pci-driver.c:533:12: error: ‘pci_restore_standard_config’ defined but not used [-Werror=unused-function]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied to pci/pm for v5.19, thanks!
> ---
> drivers/pci/pci-driver.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index dc18c1faf5e5..a2e6aabfa324 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -522,9 +522,9 @@ static void pci_device_shutdown(struct device *dev)
> pci_clear_master(pci_dev);
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
>
> -/* Auxiliary functions used for system resume and run-time resume. */
> +/* Auxiliary functions used for system resume. */
>
> /**
> * pci_restore_standard_config - restore standard config registers of PCI device
> @@ -544,6 +544,11 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev)
> pci_pme_restore(pci_dev);
> return 0;
> }
> +#endif /* CONFIG_PM_SLEEP */
> +
> +#ifdef CONFIG_PM
> +
> +/* Auxiliary functions used for system resume and run-time resume. */
>
> static void pci_pm_default_resume(struct pci_dev *pci_dev)
> {
> @@ -558,8 +563,7 @@ static void pci_pm_default_resume_early(struct pci_dev *pci_dev)
> pci_restore_state(pci_dev);
> pci_pme_restore(pci_dev);
> }
> -
> -#endif
> +#endif /* CONFIG_PM */
>
> #ifdef CONFIG_PM_SLEEP
>
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-20 15:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 14:11 [PATCH] PCI: fix unused pci_restore_standard_config without suspend/hibernate Krzysztof Kozlowski
2022-04-20 15:58 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).