diff mbox series

drm/tegra: mark nvdec PM functions as __maybe_unused

Message ID 20211013144148.2208472-1-arnd@kernel.org
State New
Headers show
Series drm/tegra: mark nvdec PM functions as __maybe_unused | expand

Commit Message

Arnd Bergmann Oct. 13, 2021, 2:41 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


The resume helper is called conditionally and causes a harmless
warning when stubbed out:

drivers/gpu/drm/tegra/nvdec.c:240:12: error: 'nvdec_runtime_resume' defined but not used [-Werror=unused-function]
  240 | static int nvdec_runtime_resume(struct device *dev)

Mark both suspend and resume as __maybe_unused for consistency
to avoid this warning.

Fixes: e76599df354d ("drm/tegra: Add NVDEC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/gpu/drm/tegra/nvdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.29.2

Comments

Thierry Reding Oct. 18, 2021, 1:56 p.m. UTC | #1
On Wed, Oct 13, 2021 at 04:41:36PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>

> 

> The resume helper is called conditionally and causes a harmless

> warning when stubbed out:

> 

> drivers/gpu/drm/tegra/nvdec.c:240:12: error: 'nvdec_runtime_resume' defined but not used [-Werror=unused-function]

>   240 | static int nvdec_runtime_resume(struct device *dev)

> 

> Mark both suspend and resume as __maybe_unused for consistency

> to avoid this warning.

> 

> Fixes: e76599df354d ("drm/tegra: Add NVDEC driver")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  drivers/gpu/drm/tegra/nvdec.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)


Applied, thanks.

Thierry
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c
index 30105a93de9f..791bf1acf5f0 100644
--- a/drivers/gpu/drm/tegra/nvdec.c
+++ b/drivers/gpu/drm/tegra/nvdec.c
@@ -238,7 +238,7 @@  static int nvdec_load_firmware(struct nvdec *nvdec)
 }
 
 
-static int nvdec_runtime_resume(struct device *dev)
+static __maybe_unused int nvdec_runtime_resume(struct device *dev)
 {
 	struct nvdec *nvdec = dev_get_drvdata(dev);
 	int err;
@@ -264,7 +264,7 @@  static int nvdec_runtime_resume(struct device *dev)
 	return err;
 }
 
-static int nvdec_runtime_suspend(struct device *dev)
+static __maybe_unused int nvdec_runtime_suspend(struct device *dev)
 {
 	struct nvdec *nvdec = dev_get_drvdata(dev);