diff mbox series

memory: tegra: avoid unused function warnings

Message ID 20200408190043.532711-1-arnd@arndb.de
State Accepted
Headers show
Series memory: tegra: avoid unused function warnings | expand

Commit Message

Arnd Bergmann April 8, 2020, 7 p.m. UTC
The suspend/resume functions have no callers depending on
configuration, so they must be marked __maybe_unused to
avoid these harmless warnings:

drivers/memory/tegra/tegra186.c:1578:12: error: 'tegra186_mc_resume' defined but not used [-Werror=unused-function]
 1578 | static int tegra186_mc_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~
drivers/memory/tegra/tegra186.c:1573:12: error: 'tegra186_mc_suspend' defined but not used [-Werror=unused-function]
 1573 | static int tegra186_mc_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~

Fixes: 177602b00641 ("memory: tegra: Add system sleep support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/memory/tegra/tegra186.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thierry Reding April 9, 2020, 3:01 p.m. UTC | #1
On Wed, Apr 08, 2020 at 09:00:30PM +0200, Arnd Bergmann wrote:
> The suspend/resume functions have no callers depending on
> configuration, so they must be marked __maybe_unused to
> avoid these harmless warnings:
> 
> drivers/memory/tegra/tegra186.c:1578:12: error: 'tegra186_mc_resume' defined but not used [-Werror=unused-function]
>  1578 | static int tegra186_mc_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~
> drivers/memory/tegra/tegra186.c:1573:12: error: 'tegra186_mc_suspend' defined but not used [-Werror=unused-function]
>  1573 | static int tegra186_mc_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~
> 
> Fixes: 177602b00641 ("memory: tegra: Add system sleep support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/memory/tegra/tegra186.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Do you want to apply this to ARM SoC directly or would you prefer if I
collected fixes and send a PR sometime later in the cycle?

If the former:

Acked-by: Thierry Reding <treding@nvidia.com>
Thierry Reding May 7, 2020, 8:02 p.m. UTC | #2
On Wed, Apr 08, 2020 at 09:00:30PM +0200, Arnd Bergmann wrote:
> The suspend/resume functions have no callers depending on
> configuration, so they must be marked __maybe_unused to
> avoid these harmless warnings:
> 
> drivers/memory/tegra/tegra186.c:1578:12: error: 'tegra186_mc_resume' defined but not used [-Werror=unused-function]
>  1578 | static int tegra186_mc_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~
> drivers/memory/tegra/tegra186.c:1573:12: error: 'tegra186_mc_suspend' defined but not used [-Werror=unused-function]
>  1573 | static int tegra186_mc_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~
> 
> Fixes: 177602b00641 ("memory: tegra: Add system sleep support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/memory/tegra/tegra186.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-5.8/memory, thanks.

Thierry
diff mbox series

Patch

diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index 5d53f11ca7b6..e25c954dde2e 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -1570,12 +1570,12 @@  static const struct of_device_id tegra186_mc_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, tegra186_mc_of_match);
 
-static int tegra186_mc_suspend(struct device *dev)
+static int __maybe_unused tegra186_mc_suspend(struct device *dev)
 {
 	return 0;
 }
 
-static int tegra186_mc_resume(struct device *dev)
+static int __maybe_unused tegra186_mc_resume(struct device *dev)
 {
 	struct tegra186_mc *mc = dev_get_drvdata(dev);