dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: tegra210-adma: mark PM funtions as __maybe_unused
@ 2019-07-09 18:56 Arnd Bergmann
  2019-07-10  8:42 ` Jon Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2019-07-09 18:56 UTC (permalink / raw)
  To: Laxman Dewangan, Jon Hunter, Vinod Koul, Thierry Reding
  Cc: Arnd Bergmann, Sameer Pujar, Vinod Koul, Dan Williams, dmaengine,
	linux-tegra, linux-kernel

Without the CONFIG_PM_CLK dependency, we can now build this file
in kernels that don't have CONFIG_PM at all, resulting in a harmless
warning from code that was always there since it got merged:

drivers/dma/tegra210-adma.c:747:12: error: 'tegra_adma_runtime_resume' defined but not used [-Werror=unused-function]
 static int tegra_adma_runtime_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/tegra210-adma.c:715:12: error: 'tegra_adma_runtime_suspend' defined but not used [-Werror=unused-function]
 static int tegra_adma_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

Mark them __maybe_unused to let the compiler silently drop
those two functions.

Fixes: 3145d73e69ba ("dmaengine: tegra210-adma: remove PM_CLK dependency")
Fixes: f46b195799b5 ("dmaengine: tegra-adma: Add support for Tegra210 ADMA")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/dma/tegra210-adma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index 2805853e963f..2b4be5557b37 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -712,7 +712,7 @@ static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec,
 	return chan;
 }
 
-static int tegra_adma_runtime_suspend(struct device *dev)
+static __maybe_unused int tegra_adma_runtime_suspend(struct device *dev)
 {
 	struct tegra_adma *tdma = dev_get_drvdata(dev);
 	struct tegra_adma_chan_regs *ch_reg;
@@ -744,7 +744,7 @@ static int tegra_adma_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int tegra_adma_runtime_resume(struct device *dev)
+static __maybe_unused int tegra_adma_runtime_resume(struct device *dev)
 {
 	struct tegra_adma *tdma = dev_get_drvdata(dev);
 	struct tegra_adma_chan_regs *ch_reg;
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: tegra210-adma: mark PM funtions as __maybe_unused
  2019-07-09 18:56 [PATCH] dmaengine: tegra210-adma: mark PM funtions as __maybe_unused Arnd Bergmann
@ 2019-07-10  8:42 ` Jon Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2019-07-10  8:42 UTC (permalink / raw)
  To: Arnd Bergmann, Laxman Dewangan, Vinod Koul, Thierry Reding
  Cc: Sameer Pujar, Vinod Koul, Dan Williams, dmaengine, linux-tegra,
	linux-kernel


On 09/07/2019 19:56, Arnd Bergmann wrote:
> Without the CONFIG_PM_CLK dependency, we can now build this file
> in kernels that don't have CONFIG_PM at all, resulting in a harmless
> warning from code that was always there since it got merged:
> 
> drivers/dma/tegra210-adma.c:747:12: error: 'tegra_adma_runtime_resume' defined but not used [-Werror=unused-function]
>  static int tegra_adma_runtime_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/dma/tegra210-adma.c:715:12: error: 'tegra_adma_runtime_suspend' defined but not used [-Werror=unused-function]
>  static int tegra_adma_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Mark them __maybe_unused to let the compiler silently drop
> those two functions.
> 
> Fixes: 3145d73e69ba ("dmaengine: tegra210-adma: remove PM_CLK dependency")
> Fixes: f46b195799b5 ("dmaengine: tegra-adma: Add support for Tegra210 ADMA")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/dma/tegra210-adma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> index 2805853e963f..2b4be5557b37 100644
> --- a/drivers/dma/tegra210-adma.c
> +++ b/drivers/dma/tegra210-adma.c
> @@ -712,7 +712,7 @@ static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec,
>  	return chan;
>  }
>  
> -static int tegra_adma_runtime_suspend(struct device *dev)
> +static __maybe_unused int tegra_adma_runtime_suspend(struct device *dev)
>  {
>  	struct tegra_adma *tdma = dev_get_drvdata(dev);
>  	struct tegra_adma_chan_regs *ch_reg;
> @@ -744,7 +744,7 @@ static int tegra_adma_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_adma_runtime_resume(struct device *dev)
> +static __maybe_unused int tegra_adma_runtime_resume(struct device *dev)
>  {
>  	struct tegra_adma *tdma = dev_get_drvdata(dev);
>  	struct tegra_adma_chan_regs *ch_reg;
> 

Thanks Arnd, but looks like Yue has beaten you to it again ;-)

https://www.lkml.org/lkml/2019/7/9/209

Cheers
Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-10  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09 18:56 [PATCH] dmaengine: tegra210-adma: mark PM funtions as __maybe_unused Arnd Bergmann
2019-07-10  8:42 ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).