diff mbox

[28/30] dmaengine: tegra-apb: fix unused-function warnings

Message ID 1473960849-23024-29-git-send-email-vinod.koul@intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Vinod Koul Sept. 15, 2016, 5:34 p.m. UTC
when CONFIG_PM is not defined, the compiler warns

  CC      drivers/dma/tegra210-adma.o
drivers/dma/tegra210-adma.c:635:12: warning: 'tegra_adma_runtime_suspend' defined but not used [-Wunused-function]
 static int tegra_adma_runtime_suspend(struct device *dev)
            ^
drivers/dma/tegra210-adma.c:644:12: warning: 'tegra_adma_runtime_resume' defined but not used [-Wunused-function]
 static int tegra_adma_runtime_resume(struct device *dev)
            ^

Although driver uses SET_RUNTIME_PM_OPS but doesn't add protection for these
symbols causing warning when CONFIG_PM is not defined, so add CONFIG_PM
around these symbols.

Cc: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/tegra210-adma.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jon Hunter Sept. 15, 2016, 9:15 p.m. UTC | #1
On 15/09/16 18:34, Vinod Koul wrote:
> when CONFIG_PM is not defined, the compiler warns
> 
>   CC      drivers/dma/tegra210-adma.o
> drivers/dma/tegra210-adma.c:635:12: warning: 'tegra_adma_runtime_suspend' defined but not used [-Wunused-function]
>  static int tegra_adma_runtime_suspend(struct device *dev)
>             ^
> drivers/dma/tegra210-adma.c:644:12: warning: 'tegra_adma_runtime_resume' defined but not used [-Wunused-function]
>  static int tegra_adma_runtime_resume(struct device *dev)
>             ^
> 
> Although driver uses SET_RUNTIME_PM_OPS but doesn't add protection for these
> symbols causing warning when CONFIG_PM is not defined, so add CONFIG_PM
> around these symbols.
> 
> Cc: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
>  drivers/dma/tegra210-adma.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> index c4b121c4559d..e8ee6f95ddb2 100644
> --- a/drivers/dma/tegra210-adma.c
> +++ b/drivers/dma/tegra210-adma.c
> @@ -632,6 +632,7 @@ static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec,
>  	return chan;
>  }
>  
> +#ifdef CONFIG_PM
>  static int tegra_adma_runtime_suspend(struct device *dev)
>  {
>  	struct tegra_adma *tdma = dev_get_drvdata(dev);
> @@ -654,6 +655,7 @@ static int tegra_adma_runtime_resume(struct device *dev)
>  
>  	return 0;
>  }
> +#endif
>  
>  static const struct tegra_adma_chip_data tegra210_chip_data = {
>  	.nr_channels = 22,

Can you fix the $subject to be "tegra-adma"? Otherwise ...

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon
Vinod Koul Sept. 16, 2016, 2:18 p.m. UTC | #2
On Thu, Sep 15, 2016 at 10:15:02PM +0100, Jon Hunter wrote:
> 
> On 15/09/16 18:34, Vinod Koul wrote:
> > when CONFIG_PM is not defined, the compiler warns
> > 
> >   CC      drivers/dma/tegra210-adma.o
> > drivers/dma/tegra210-adma.c:635:12: warning: 'tegra_adma_runtime_suspend' defined but not used [-Wunused-function]
> >  static int tegra_adma_runtime_suspend(struct device *dev)
> >             ^
> > drivers/dma/tegra210-adma.c:644:12: warning: 'tegra_adma_runtime_resume' defined but not used [-Wunused-function]
> >  static int tegra_adma_runtime_resume(struct device *dev)
> >             ^
> > 
> > Although driver uses SET_RUNTIME_PM_OPS but doesn't add protection for these
> > symbols causing warning when CONFIG_PM is not defined, so add CONFIG_PM
> > around these symbols.
> > 
> > Cc: Jon Hunter <jonathanh@nvidia.com>
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > ---
> >  drivers/dma/tegra210-adma.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> > index c4b121c4559d..e8ee6f95ddb2 100644
> > --- a/drivers/dma/tegra210-adma.c
> > +++ b/drivers/dma/tegra210-adma.c
> > @@ -632,6 +632,7 @@ static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec,
> >  	return chan;
> >  }
> >  
> > +#ifdef CONFIG_PM
> >  static int tegra_adma_runtime_suspend(struct device *dev)
> >  {
> >  	struct tegra_adma *tdma = dev_get_drvdata(dev);
> > @@ -654,6 +655,7 @@ static int tegra_adma_runtime_resume(struct device *dev)
> >  
> >  	return 0;
> >  }
> > +#endif
> >  
> >  static const struct tegra_adma_chip_data tegra210_chip_data = {
> >  	.nr_channels = 22,
> 
> Can you fix the $subject to be "tegra-adma"? Otherwise ...

Sure will update tegra patches, I looked at driver names, whereas should
have looked at the log.
diff mbox

Patch

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index c4b121c4559d..e8ee6f95ddb2 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -632,6 +632,7 @@  static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec,
 	return chan;
 }
 
+#ifdef CONFIG_PM
 static int tegra_adma_runtime_suspend(struct device *dev)
 {
 	struct tegra_adma *tdma = dev_get_drvdata(dev);
@@ -654,6 +655,7 @@  static int tegra_adma_runtime_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static const struct tegra_adma_chip_data tegra210_chip_data = {
 	.nr_channels = 22,