Skip to contentSkip to conversation

pinctrl: msm: mark PM functions as __maybe_unused

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

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

PATCH 1/1 pinctrl: msm: mark PM functions as __maybe_unused

Without CONFIG_PM_SLEEP, we get annoyting warnings about unused functions:

drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function]
static int msm_pinctrl_resume(struct device *dev)

            ^~~~~~~~~~~~~~~~~~

drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function]
static int msm_pinctrl_suspend(struct device *dev)

Mark them as __maybe_unused to shut up the warning and silently drop the functions without having to add ugly #ifdefs.

Fixes 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions")
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/qcom/pinctrl-msm.c +2 -2
index 87cbebe217fd..ee8119879c4c 100644
@@ -1072,14 +1072,14 @@ static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
 		}
 }
 
-static int msm_pinctrl_suspend(struct device *dev)
+static __maybe_unused int msm_pinctrl_suspend(struct device *dev)
 {
 	struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
 
 	return pinctrl_force_sleep(pctrl->pctrl);
 }
 
-static int msm_pinctrl_resume(struct device *dev)
+static __maybe_unused int msm_pinctrl_resume(struct device *dev)
 {
 	struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
 
Signature · 1 line
2.20.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Arnd Bergmann

Without CONFIG_PM_SLEEP, we get annoyting warnings about unused functions:

drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function]
static int msm_pinctrl_resume(struct device *dev)

            ^~~~~~~~~~~~~~~~~~

drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function]
static int msm_pinctrl_suspend(struct device *dev)

Mark them as __maybe_unused to shut up the warning and silently drop the functions without having to add ugly #ifdefs.

Fixes 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions")
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/qcom/pinctrl-msm.c +1 -1
index 87cbebe217fd..ee8119879c4c 100644
@@ -1072,14 +1072,14 @@ static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
                }
 }
 
-static int msm_pinctrl_suspend(struct device *dev)
+static __maybe_unused int msm_pinctrl_suspend(struct device *dev)
 {

drivers/pinctrl/qcom/pinctrl-msm.c static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl) · line 1085

Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-msm.c +1 -1
        struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
 
        return pinctrl_force_sleep(pctrl->pctrl);
 }
 
-static int msm_pinctrl_resume(struct device *dev)
+static __maybe_unused int msm_pinctrl_resume(struct device *dev)
 {
        struct msm_pinctrl *pctrl = dev_get_drvdata(dev);
 

Thanks Arnd.

#2 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

Without CONFIG_PM_SLEEP, we get annoyting warnings about unused functions:

drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function]
static int msm_pinctrl_resume(struct device *dev)

            ^~~~~~~~~~~~~~~~~~
Quoted 8 lines

drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function]
static int msm_pinctrl_suspend(struct device *dev)

Mark them as __maybe_unused to shut up the warning and silently drop the functions without having to add ugly #ifdefs.

Fixes 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions")

Patch applied w/ACKs and fixing a typo.

Yours,
Linus Walleij