Skip to contentSkip to conversation

mmc: sdhci-msm: avoid unused function warning

PATCH In review Arnd Bergmann 3 participants 3 messages Dec 10, 2018 – Dec 11, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-msm: avoid unused function warning

The newly added sdhci_msm_restore_sdr_dll_config() function is only called if CONFIG_PM is enabled:

drivers/mmc/host/sdhci-msm.c:1050:12: error: 'sdhci_msm_restore_sdr_dll_config' defined but not used [-Werror=unused-function]

Better remove the incorrect #ifdef altogether and just use __maybe_unused, which is harder to get wrong.

Fixes ec3349733550 ("mmc: sdhci-msm: Re-initialize DLL if MCLK is gated dynamically")
---
 drivers/mmc/host/sdhci-msm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-msm.c +2 -4
index 5497a71abe07..d6c9ebd8d263 100644
@@ -1997,8 +1997,7 @@ static int sdhci_msm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int sdhci_msm_runtime_suspend(struct device *dev)
+static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2010,7 +2009,7 @@ static int sdhci_msm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int sdhci_msm_runtime_resume(struct device *dev)
+static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2030,7 +2029,6 @@ static int sdhci_msm_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_msm_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
Signature · 1 line
2.20.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The newly added sdhci_msm_restore_sdr_dll_config() function is only called if CONFIG_PM is enabled:

drivers/mmc/host/sdhci-msm.c:1050:12: error: 'sdhci_msm_restore_sdr_dll_config' defined but not used [-Werror=unused-function]

Better remove the incorrect #ifdef altogether and just use __maybe_unused, which is harder to get wrong.

Fixes ec3349733550 ("mmc: sdhci-msm: Re-initialize DLL if MCLK is gated dynamically")
Quoted 36 lines
---
 drivers/mmc/host/sdhci-msm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-msm.c +2 -4
index 5497a71abe07..d6c9ebd8d263 100644
@@ -1997,8 +1997,7 @@ static int sdhci_msm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int sdhci_msm_runtime_suspend(struct device *dev)
+static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2010,7 +2009,7 @@ static int sdhci_msm_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int sdhci_msm_runtime_resume(struct device *dev)
+static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2030,7 +2029,6 @@ static int sdhci_msm_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_msm_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
#2 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

The newly added sdhci_msm_restore_sdr_dll_config() function is only called if CONFIG_PM is enabled:

drivers/mmc/host/sdhci-msm.c:1050:12: error: 'sdhci_msm_restore_sdr_dll_config' defined but not used [-Werror=unused-function]

Better remove the incorrect #ifdef altogether and just use __maybe_unused, which is harder to get wrong.

Fixes ec3349733550 ("mmc: sdhci-msm: Re-initialize DLL if MCLK is gated dynamically")

Applied for next, thanks!

Kind regards
Uffe

Quoted 38 lines
---
 drivers/mmc/host/sdhci-msm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-msm.c +2 -5
index 5497a71abe07..d6c9ebd8d263 100644
@@ -1997,8 +1997,7 @@ static int sdhci_msm_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int sdhci_msm_runtime_suspend(struct device *dev)
+static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev)
 {
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2010,7 +2009,7 @@ static int sdhci_msm_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int sdhci_msm_runtime_resume(struct device *dev)
+static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev)
 {
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2030,7 +2029,6 @@ static int sdhci_msm_runtime_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_msm_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
--

2.20.0