dmaengine: tegra210-adma: mark PM funtions as __maybe_unused
Subsystems (3)
PATCH 1/1 dmaengine: tegra210-adma: mark PM funtions as __maybe_unused
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.
--- drivers/dma/tegra210-adma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/tegra210-adma.c +2 -2
@@ -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;
Signature · 1 line
2.20.0
Jon Hunter
maintainerQuoted 36 lines · Arnd Bergmann
Without the
CONFIG_PM_CLKdependency, we can now build this file in kernels that don't haveCONFIG_PMat 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 inttegra_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_unusedto 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 <[email protected]>--- drivers/dma/tegra210-adma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/dma/tegra210-adma.c +1
-1@@ -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;
drivers/dma/tegra210-adma.c static int tegra_adma_runtime_suspend(struct device *dev) · line 750
Quoted 8 lines
drivers/dma/tegra210-adma.c +1
-1@@ -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
Signature · 1 line
nvpublic