Skip to contentSkip to conversation

iio: imx8qxp-adc: mark PM functions as __maybe_unused

PATCH In review Arnd Bergmann 4 participants 4 messages Oct 13, 2021 – Oct 14, 2021

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

PATCH 1/1 iio: imx8qxp-adc: mark PM functions as __maybe_unused

From: Arnd Bergmann <[email protected]>

Without CONFIG_PM_SLEEP, the runtime suspend/resume functions are unused, producing a warning:

drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
433 | static int imx8qxp_adc_runtime_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
  419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Mark them as __maybe_unused to shut up the compiler.

Fixes 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
---
 drivers/iio/adc/imx8qxp-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/imx8qxp-adc.c +2 -2
index 5030e0d8318d..901dd8e1b32f 100644
@@ -416,7 +416,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int imx8qxp_adc_runtime_suspend(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct imx8qxp_adc *adc = iio_priv(indio_dev);
@@ -430,7 +430,7 @@ static int imx8qxp_adc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int imx8qxp_adc_runtime_resume(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct imx8qxp_adc *adc = iio_priv(indio_dev);
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Without CONFIG_PM_SLEEP, the runtime suspend/resume functions are unused, producing a warning:

drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
433 | static int imx8qxp_adc_runtime_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
  419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 4 lines

Mark them as __maybe_unused to shut up the compiler.

Fixes 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
Quoted 29 lines
---
 drivers/iio/adc/imx8qxp-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/imx8qxp-adc.c +2 -2
index 5030e0d8318d..901dd8e1b32f 100644
@@ -416,7 +416,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int imx8qxp_adc_runtime_suspend(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct imx8qxp_adc *adc = iio_priv(indio_dev);
@@ -430,7 +430,7 @@ static int imx8qxp_adc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int imx8qxp_adc_runtime_resume(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct imx8qxp_adc *adc = iio_priv(indio_dev);
Signature · 1 line
2.29.2
#2 lore raw
Quoted 13 lines · Cai Huoqing
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Without CONFIG_PM_SLEEP, the runtime suspend/resume functions are unused, producing a warning:

drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
433 | static int imx8qxp_adc_runtime_resume(struct device *dev)

       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
   419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
Quoted 4 lines

Mark them as __maybe_unused to shut up the compiler.

Fixes 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")

Looks the same as
https://lore.kernel.org/all/[email protected]/

but that one is mixing the Fixes: tag.

Quoted 27 lines
Quoted 27 lines
---
  drivers/iio/adc/imx8qxp-adc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/imx8qxp-adc.c +2 -2
index 5030e0d8318d..901dd8e1b32f 100644
@@ -416,7 +416,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
  	return 0;
  }
 
-static int imx8qxp_adc_runtime_suspend(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev)
  {
  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
  	struct imx8qxp_adc *adc = iio_priv(indio_dev);
@@ -430,7 +430,7 @@ static int imx8qxp_adc_runtime_suspend(struct device *dev)
  	return 0;
  }
 
-static int imx8qxp_adc_runtime_resume(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
  {
  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
  	struct imx8qxp_adc *adc = iio_priv(indio_dev);
Signature · 1 line
~Randy
maintainer
#3 lore raw
Quoted 19 lines · On Wed, 13 Oct 2021 18:40:41 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 18 lines · Cai Huoqing
Quoted 16 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Without CONFIG_PM_SLEEP, the runtime suspend/resume functions are unused, producing a warning:

drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
433 | static int imx8qxp_adc_runtime_resume(struct device *dev)

       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
   419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Mark them as __maybe_unused to shut up the compiler.

Fixes 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
Quoted 6 lines
Quoted 1 line

Looks the same as
https://lore.kernel.org/all/[email protected]/

but that one is mixing the Fixes: tag.

Given Cai replied to this one and the presence of the fixes tag + my inherent laziness, applied this one to the togreg branch of iio.git. I'll push that out as testing to let 0-day poke it before pushing it out for next to pick up in a day or 2.

Thanks,

Jonathan

Quoted 32 lines
Quoted 28 lines
Quoted 28 lines
---
  drivers/iio/adc/imx8qxp-adc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/imx8qxp-adc.c +2 -2
index 5030e0d8318d..901dd8e1b32f 100644
@@ -416,7 +416,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
  	return 0;
  }
 
-static int imx8qxp_adc_runtime_suspend(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev)
  {
  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
  	struct imx8qxp_adc *adc = iio_priv(indio_dev);
@@ -430,7 +430,7 @@ static int imx8qxp_adc_runtime_suspend(struct device *dev)
  	return 0;
  }
 
-static int imx8qxp_adc_runtime_resume(struct device *dev)
+static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
  {
  	struct iio_dev *indio_dev = dev_get_drvdata(dev);
  	struct imx8qxp_adc *adc = iio_priv(indio_dev);