All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/hisilicon/hibmc: mark PM functions __maybe_unused
@ 2016-11-24 16:30 Arnd Bergmann
  2016-11-25  6:44   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-11-24 16:30 UTC (permalink / raw)
  To: Xinliang Liu, Rongrong Zou
  Cc: Arnd Bergmann, Xinwei Kong, Chen Feng, David Airlie, Sean Paul,
	dri-devel, linux-kernel

When CONFIG_PM_SLEEP is disabled, we get a harmless warning

drm/hisilicon/hibmc/hibmc_drm_drv.c:115:12: error: ‘hibmc_pm_resume’ defined but not used [-Werror=unused-function]
drm/hisilicon/hibmc/hibmc_drm_drv.c:97:12: error: ‘hibmc_pm_suspend’ defined but not used [-Werror=unused-function]

Marking the functions as __maybe_unused avoids the warning without
having to add an #ifdef.

Fixes: 5e0df3a08f3d ("drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 73ba8b05f1da..fd949df46717 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -94,7 +94,7 @@ static struct drm_driver hibmc_driver = {
 	.irq_handler		= hibmc_drm_interrupt,
 };
 
-static int hibmc_pm_suspend(struct device *dev)
+static int __maybe_unused hibmc_pm_suspend(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct drm_device *drm_dev = pci_get_drvdata(pdev);
@@ -112,7 +112,7 @@ static int hibmc_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int hibmc_pm_resume(struct device *dev)
+static int  __maybe_unused hibmc_pm_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct drm_device *drm_dev = pci_get_drvdata(pdev);
-- 
2.9.0

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

* Re: [PATCH] drm/hisilicon/hibmc: mark PM functions __maybe_unused
  2016-11-24 16:30 [PATCH] drm/hisilicon/hibmc: mark PM functions __maybe_unused Arnd Bergmann
@ 2016-11-25  6:44   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2016-11-25  6:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Xinliang Liu, Rongrong Zou, Chen Feng, linux-kernel, dri-devel

On Thu, Nov 24, 2016 at 05:30:26PM +0100, Arnd Bergmann wrote:
> When CONFIG_PM_SLEEP is disabled, we get a harmless warning
> 
> drm/hisilicon/hibmc/hibmc_drm_drv.c:115:12: error: ‘hibmc_pm_resume’ defined but not used [-Werror=unused-function]
> drm/hisilicon/hibmc/hibmc_drm_drv.c:97:12: error: ‘hibmc_pm_suspend’ defined but not used [-Werror=unused-function]
> 
> Marking the functions as __maybe_unused avoids the warning without
> having to add an #ifdef.
> 
> Fixes: 5e0df3a08f3d ("drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to drm-misc, thx.
-Daniel

> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 73ba8b05f1da..fd949df46717 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -94,7 +94,7 @@ static struct drm_driver hibmc_driver = {
>  	.irq_handler		= hibmc_drm_interrupt,
>  };
>  
> -static int hibmc_pm_suspend(struct device *dev)
> +static int __maybe_unused hibmc_pm_suspend(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct drm_device *drm_dev = pci_get_drvdata(pdev);
> @@ -112,7 +112,7 @@ static int hibmc_pm_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int hibmc_pm_resume(struct device *dev)
> +static int  __maybe_unused hibmc_pm_resume(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct drm_device *drm_dev = pci_get_drvdata(pdev);
> -- 
> 2.9.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm/hisilicon/hibmc: mark PM functions __maybe_unused
@ 2016-11-25  6:44   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2016-11-25  6:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Xinliang Liu, Rongrong Zou, linux-kernel, dri-devel, Chen Feng

On Thu, Nov 24, 2016 at 05:30:26PM +0100, Arnd Bergmann wrote:
> When CONFIG_PM_SLEEP is disabled, we get a harmless warning
> 
> drm/hisilicon/hibmc/hibmc_drm_drv.c:115:12: error: ‘hibmc_pm_resume’ defined but not used [-Werror=unused-function]
> drm/hisilicon/hibmc/hibmc_drm_drv.c:97:12: error: ‘hibmc_pm_suspend’ defined but not used [-Werror=unused-function]
> 
> Marking the functions as __maybe_unused avoids the warning without
> having to add an #ifdef.
> 
> Fixes: 5e0df3a08f3d ("drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to drm-misc, thx.
-Daniel

> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 73ba8b05f1da..fd949df46717 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -94,7 +94,7 @@ static struct drm_driver hibmc_driver = {
>  	.irq_handler		= hibmc_drm_interrupt,
>  };
>  
> -static int hibmc_pm_suspend(struct device *dev)
> +static int __maybe_unused hibmc_pm_suspend(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct drm_device *drm_dev = pci_get_drvdata(pdev);
> @@ -112,7 +112,7 @@ static int hibmc_pm_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int hibmc_pm_resume(struct device *dev)
> +static int  __maybe_unused hibmc_pm_resume(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct drm_device *drm_dev = pci_get_drvdata(pdev);
> -- 
> 2.9.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-11-25  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 16:30 [PATCH] drm/hisilicon/hibmc: mark PM functions __maybe_unused Arnd Bergmann
2016-11-25  6:44 ` Daniel Vetter
2016-11-25  6:44   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.