* [PATCH] dmaengine: qcom-bam-dma: add __maybe_unused annotations for PM
@ 2016-07-04 13:14 Arnd Bergmann
2016-07-06 17:10 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-07-04 13:14 UTC (permalink / raw)
To: Vinod Koul
Cc: Arnd Bergmann, Dan Williams, Andy Gross, Stanimir Varbanov,
dmaengine, linux-kernel
The bam_dma driver gained runtime PM support, but that causes build
warnings whenever CONFIG_PM is disabled:
drivers/dma/qcom/bam_dma.c:1324:12: error: 'bam_dma_runtime_resume' defined but not used [-Werror=unused-function]
static int bam_dma_runtime_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~
drivers/dma/qcom/bam_dma.c:1315:12: error: 'bam_dma_runtime_suspend' defined but not used [-Werror=unused-function]
static int bam_dma_runtime_suspend(struct device *dev)
This removes the incomplete #ifdef guard and instead marks all
four PM functions as __maybe_unused, which avoids this kind of
warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 7d2545599f5b ("dmaengine: qcom-bam-dma: Add pm_runtime support")
---
drivers/dma/qcom/bam_dma.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 4754891742ad..03c4eb3fd314 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1312,7 +1312,7 @@ static int bam_dma_remove(struct platform_device *pdev)
return 0;
}
-static int bam_dma_runtime_suspend(struct device *dev)
+static int __maybe_unused bam_dma_runtime_suspend(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
@@ -1321,7 +1321,7 @@ static int bam_dma_runtime_suspend(struct device *dev)
return 0;
}
-static int bam_dma_runtime_resume(struct device *dev)
+static int __maybe_unused bam_dma_runtime_resume(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
int ret;
@@ -1334,8 +1334,8 @@ static int bam_dma_runtime_resume(struct device *dev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int bam_dma_suspend(struct device *dev)
+
+static int __maybe_unused bam_dma_suspend(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
@@ -1346,7 +1346,7 @@ static int bam_dma_suspend(struct device *dev)
return 0;
}
-static int bam_dma_resume(struct device *dev)
+static int __maybe_unused bam_dma_resume(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
int ret;
@@ -1359,7 +1359,6 @@ static int bam_dma_resume(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops bam_dma_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(bam_dma_suspend, bam_dma_resume)
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: qcom-bam-dma: add __maybe_unused annotations for PM
2016-07-04 13:14 [PATCH] dmaengine: qcom-bam-dma: add __maybe_unused annotations for PM Arnd Bergmann
@ 2016-07-06 17:10 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2016-07-06 17:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dan Williams, Andy Gross, Stanimir Varbanov, dmaengine,
linux-kernel
On Mon, Jul 04, 2016 at 03:14:08PM +0200, Arnd Bergmann wrote:
> The bam_dma driver gained runtime PM support, but that causes build
> warnings whenever CONFIG_PM is disabled:
>
> drivers/dma/qcom/bam_dma.c:1324:12: error: 'bam_dma_runtime_resume' defined but not used [-Werror=unused-function]
> static int bam_dma_runtime_resume(struct device *dev)
> ^~~~~~~~~~~~~~~~~~~~~~
> drivers/dma/qcom/bam_dma.c:1315:12: error: 'bam_dma_runtime_suspend' defined but not used [-Werror=unused-function]
> static int bam_dma_runtime_suspend(struct device *dev)
>
> This removes the incomplete #ifdef guard and instead marks all
> four PM functions as __maybe_unused, which avoids this kind of
> warning.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-06 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-04 13:14 [PATCH] dmaengine: qcom-bam-dma: add __maybe_unused annotations for PM Arnd Bergmann
2016-07-06 17:10 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox