diff mbox series

dmaengine: ti: k3-udma: annotate pm function with __maybe_unused

Message ID 20230516174311.117264-1-vkoul@kernel.org (mailing list archive)
State Accepted
Commit 38de368a66360f1859428d5e191b45bd01c20786
Headers show
Series dmaengine: ti: k3-udma: annotate pm function with __maybe_unused | expand

Commit Message

Vinod Koul May 16, 2023, 5:43 p.m. UTC
We get a warning when PM is not set:

../drivers/dma/ti/k3-udma.c:5552:12: warning: 'udma_pm_resume' defined but not used [-Wunused-function]
 5552 | static int udma_pm_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~
../drivers/dma/ti/k3-udma.c:5530:12: warning: 'udma_pm_suspend' defined but not used [-Wunused-function]
 5530 | static int udma_pm_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~

Fix this by annotating pm function with __maybe_unused

Fixes: fbe05149e40b ("dmaengine: ti: k3-udma: Add system suspend/resume support")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/dma/ti/k3-udma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Randy Dunlap May 16, 2023, 9:36 p.m. UTC | #1
On 5/16/23 10:43, Vinod Koul wrote:
> We get a warning when PM is not set:
> 
> ../drivers/dma/ti/k3-udma.c:5552:12: warning: 'udma_pm_resume' defined but not used [-Wunused-function]
>  5552 | static int udma_pm_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~
> ../drivers/dma/ti/k3-udma.c:5530:12: warning: 'udma_pm_suspend' defined but not used [-Wunused-function]
>  5530 | static int udma_pm_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~
> 
> Fix this by annotating pm function with __maybe_unused
> 
> Fixes: fbe05149e40b ("dmaengine: ti: k3-udma: Add system suspend/resume support")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>  drivers/dma/ti/k3-udma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index fc3a2a05ab7b..b8329a23728d 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -5527,7 +5527,7 @@ static int udma_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int udma_pm_suspend(struct device *dev)
> +static int __maybe_unused udma_pm_suspend(struct device *dev)
>  {
>  	struct udma_dev *ud = dev_get_drvdata(dev);
>  	struct dma_device *dma_dev = &ud->ddev;
> @@ -5549,7 +5549,7 @@ static int udma_pm_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int udma_pm_resume(struct device *dev)
> +static int __maybe_unused udma_pm_resume(struct device *dev)
>  {
>  	struct udma_dev *ud = dev_get_drvdata(dev);
>  	struct dma_device *dma_dev = &ud->ddev;
Péter Ujfalusi May 27, 2023, 5:58 a.m. UTC | #2
On 5/16/23 20:43, Vinod Koul wrote:
> We get a warning when PM is not set:
> 
> ../drivers/dma/ti/k3-udma.c:5552:12: warning: 'udma_pm_resume' defined but not used [-Wunused-function]
>  5552 | static int udma_pm_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~
> ../drivers/dma/ti/k3-udma.c:5530:12: warning: 'udma_pm_suspend' defined but not used [-Wunused-function]
>  5530 | static int udma_pm_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~
> 
> Fix this by annotating pm function with __maybe_unused

Sorry Vinod for missing the report and not reacting.

Thanks for the fix!

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> Fixes: fbe05149e40b ("dmaengine: ti: k3-udma: Add system suspend/resume support")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  drivers/dma/ti/k3-udma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index fc3a2a05ab7b..b8329a23728d 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -5527,7 +5527,7 @@ static int udma_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int udma_pm_suspend(struct device *dev)
> +static int __maybe_unused udma_pm_suspend(struct device *dev)
>  {
>  	struct udma_dev *ud = dev_get_drvdata(dev);
>  	struct dma_device *dma_dev = &ud->ddev;
> @@ -5549,7 +5549,7 @@ static int udma_pm_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int udma_pm_resume(struct device *dev)
> +static int __maybe_unused udma_pm_resume(struct device *dev)
>  {
>  	struct udma_dev *ud = dev_get_drvdata(dev);
>  	struct dma_device *dma_dev = &ud->ddev;
diff mbox series

Patch

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index fc3a2a05ab7b..b8329a23728d 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -5527,7 +5527,7 @@  static int udma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int udma_pm_suspend(struct device *dev)
+static int __maybe_unused udma_pm_suspend(struct device *dev)
 {
 	struct udma_dev *ud = dev_get_drvdata(dev);
 	struct dma_device *dma_dev = &ud->ddev;
@@ -5549,7 +5549,7 @@  static int udma_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int udma_pm_resume(struct device *dev)
+static int __maybe_unused udma_pm_resume(struct device *dev)
 {
 	struct udma_dev *ud = dev_get_drvdata(dev);
 	struct dma_device *dma_dev = &ud->ddev;