Skip to contentSkip to conversation

remoteproc: imx_dsp_rproc: mark PM functions as __maybe_unused

PATCH In review Arnd Bergmann 2 participants 2 messages Oct 14, 2021

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

PATCH 1/1 remoteproc: imx_dsp_rproc: mark PM functions as __maybe_unused

From: Arnd Bergmann <[email protected]>

When CONFIG_PM_SLEEP is disabled, we get a harmless warning:

drivers/remoteproc/imx_dsp_rproc.c:1145:12: error: 'imx_dsp_resume' defined but not used [-Werror=unused-function]
1145 | static int imx_dsp_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~
drivers/remoteproc/imx_dsp_rproc.c:1110:12: error: 'imx_dsp_suspend' defined but not used [-Werror=unused-function]
 1110 | static int imx_dsp_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~

Mark these as __maybe_unused to get a clean build.

Fixes ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
---
 drivers/remoteproc/imx_dsp_rproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/imx_dsp_rproc.c +2 -2
index 63749cfcf22f..90fcb389e252 100644
@@ -1107,7 +1107,7 @@ static void imx_dsp_load_firmware(const struct firmware *fw, void *context)
 	release_firmware(fw);
 }
 
-static int imx_dsp_suspend(struct device *dev)
+static __maybe_unused int imx_dsp_suspend(struct device *dev)
 {
 	struct rproc *rproc = dev_get_drvdata(dev);
 	struct imx_dsp_rproc *priv = rproc->priv;
@@ -1142,7 +1142,7 @@ static int imx_dsp_suspend(struct device *dev)
 	return pm_runtime_force_suspend(dev);
 }
 
-static int imx_dsp_resume(struct device *dev)
+static __maybe_unused int imx_dsp_resume(struct device *dev)
 {
 	struct rproc *rproc = dev_get_drvdata(dev);
 	int ret = 0;
Signature · 1 line
2.29.2
maintainer
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When CONFIG_PM_SLEEP is disabled, we get a harmless warning:

drivers/remoteproc/imx_dsp_rproc.c:1145:12: error: 'imx_dsp_resume' defined but not used [-Werror=unused-function]
1145 | static int imx_dsp_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~
drivers/remoteproc/imx_dsp_rproc.c:1110:12: error: 'imx_dsp_suspend' defined but not used [-Werror=unused-function]
 1110 | static int imx_dsp_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~
Quoted 7 lines

Mark these as __maybe_unused to get a clean build.

Fixes ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
---
 drivers/remoteproc/imx_dsp_rproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I have applied this.

Thanks,
Mathieu

Quoted 26 lines
drivers/remoteproc/imx_dsp_rproc.c +2 -2
index 63749cfcf22f..90fcb389e252 100644
@@ -1107,7 +1107,7 @@ static void imx_dsp_load_firmware(const struct firmware *fw, void *context)
 	release_firmware(fw);
 }
 
-static int imx_dsp_suspend(struct device *dev)
+static __maybe_unused int imx_dsp_suspend(struct device *dev)
 {
 	struct rproc *rproc = dev_get_drvdata(dev);
 	struct imx_dsp_rproc *priv = rproc->priv;
@@ -1142,7 +1142,7 @@ static int imx_dsp_suspend(struct device *dev)
 	return pm_runtime_force_suspend(dev);
 }
 
-static int imx_dsp_resume(struct device *dev)
+static __maybe_unused int imx_dsp_resume(struct device *dev)
 {
 	struct rproc *rproc = dev_get_drvdata(dev);
 	int ret = 0;
Signature · 1 line
2.29.2