All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] drm: arm-hdlcd: fix build warnings for !CONFIG_PM
Date: Fri, 01 Jan 2016 15:39:17 +0100	[thread overview]
Message-ID: <2621741.YulfsnvZOh@wuerfel> (raw)
In-Reply-To: <4194408.X82ccDjh5X@wuerfel>

The hdlcd_pm_suspend and hdlcd_pm_resume are intentionally unused
when CONFIG_PM is not set in this driver, and we get a compiler warning
for this:

drivers/gpu/drm/arm/hdlcd_drv.c:521:12: warning: 'hdlcd_pm_suspend' defined but not used [-Wunused-function]
drivers/gpu/drm/arm/hdlcd_drv.c:536:12: warning: 'hdlcd_pm_resume' defined but not used [-Wunused-function]

This adds a __maybe_unused annotation for the two functions, to let
the compiler know this is the intended behavior. This is better than
an #ifdef as it improves the compile time coverage of the code and it
looks nicer.

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

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 31969efe97d4..6173bb835223 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -518,7 +518,7 @@ static const struct of_device_id  hdlcd_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, hdlcd_of_match);
 
-static int hdlcd_pm_suspend(struct device *dev)
+static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 	struct drm_crtc *crtc;
@@ -533,7 +533,7 @@ static int hdlcd_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int hdlcd_pm_resume(struct device *dev)
+static int __maybe_unused hdlcd_pm_resume(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 	struct drm_crtc *crtc;

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Liviu Dudau <liviu.dudau@arm.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm: arm-hdlcd: fix build warnings for !CONFIG_PM
Date: Fri, 01 Jan 2016 15:39:17 +0100	[thread overview]
Message-ID: <2621741.YulfsnvZOh@wuerfel> (raw)
In-Reply-To: <4194408.X82ccDjh5X@wuerfel>

The hdlcd_pm_suspend and hdlcd_pm_resume are intentionally unused
when CONFIG_PM is not set in this driver, and we get a compiler warning
for this:

drivers/gpu/drm/arm/hdlcd_drv.c:521:12: warning: 'hdlcd_pm_suspend' defined but not used [-Wunused-function]
drivers/gpu/drm/arm/hdlcd_drv.c:536:12: warning: 'hdlcd_pm_resume' defined but not used [-Wunused-function]

This adds a __maybe_unused annotation for the two functions, to let
the compiler know this is the intended behavior. This is better than
an #ifdef as it improves the compile time coverage of the code and it
looks nicer.

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

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 31969efe97d4..6173bb835223 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -518,7 +518,7 @@ static const struct of_device_id  hdlcd_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, hdlcd_of_match);
 
-static int hdlcd_pm_suspend(struct device *dev)
+static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 	struct drm_crtc *crtc;
@@ -533,7 +533,7 @@ static int hdlcd_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int hdlcd_pm_resume(struct device *dev)
+static int __maybe_unused hdlcd_pm_resume(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 	struct drm_crtc *crtc;

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: David Airlie <airlied@linux.ie>,
	Liviu Dudau <liviu.dudau@arm.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm: arm-hdlcd: fix build warnings for !CONFIG_PM
Date: Fri, 01 Jan 2016 15:39:17 +0100	[thread overview]
Message-ID: <2621741.YulfsnvZOh@wuerfel> (raw)
In-Reply-To: <4194408.X82ccDjh5X@wuerfel>

The hdlcd_pm_suspend and hdlcd_pm_resume are intentionally unused
when CONFIG_PM is not set in this driver, and we get a compiler warning
for this:

drivers/gpu/drm/arm/hdlcd_drv.c:521:12: warning: 'hdlcd_pm_suspend' defined but not used [-Wunused-function]
drivers/gpu/drm/arm/hdlcd_drv.c:536:12: warning: 'hdlcd_pm_resume' defined but not used [-Wunused-function]

This adds a __maybe_unused annotation for the two functions, to let
the compiler know this is the intended behavior. This is better than
an #ifdef as it improves the compile time coverage of the code and it
looks nicer.

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

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 31969efe97d4..6173bb835223 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -518,7 +518,7 @@ static const struct of_device_id  hdlcd_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, hdlcd_of_match);
 
-static int hdlcd_pm_suspend(struct device *dev)
+static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 	struct drm_crtc *crtc;
@@ -533,7 +533,7 @@ static int hdlcd_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int hdlcd_pm_resume(struct device *dev)
+static int __maybe_unused hdlcd_pm_resume(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 	struct drm_crtc *crtc;


  parent reply	other threads:[~2016-01-01 14:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01 14:09 [PATCH] drm: arm-hdlcd: remove DMA_CMA select Arnd Bergmann
2016-01-01 14:09 ` Arnd Bergmann
2016-01-01 14:09 ` Arnd Bergmann
2016-01-01 14:38 ` [PATCH 2/3] drm: arm-hdlcd: remove COMMON_CLK_SCPI select Arnd Bergmann
2016-01-01 14:38   ` Arnd Bergmann
2016-01-04  8:26   ` Thierry Reding
2016-01-04  8:26     ` Thierry Reding
2016-01-04  8:26     ` Thierry Reding
2016-01-01 14:39 ` Arnd Bergmann [this message]
2016-01-01 14:39   ` [PATCH 3/3] drm: arm-hdlcd: fix build warnings for !CONFIG_PM Arnd Bergmann
2016-01-01 14:39   ` Arnd Bergmann
2016-01-04  8:24   ` Thierry Reding
2016-01-04  8:24     ` Thierry Reding
2016-01-04  8:24     ` Thierry Reding
2016-01-01 22:04 ` [PATCH 4/3] drm: arm-hdlcd: add explictit DRM dependency Arnd Bergmann
2016-01-01 22:04   ` Arnd Bergmann
2016-01-04  8:24   ` Thierry Reding
2016-01-04  8:24     ` Thierry Reding
2016-01-04  8:24     ` Thierry Reding
2016-01-04  8:39     ` Arnd Bergmann
2016-01-04  8:39       ` Arnd Bergmann
2016-01-04  8:39       ` Arnd Bergmann
2016-01-11 11:12       ` Liviu Dudau
2016-01-11 11:12         ` Liviu Dudau
2016-01-11 12:18         ` Arnd Bergmann
2016-01-11 12:18           ` Arnd Bergmann
2016-01-11 12:26           ` Liviu Dudau
2016-01-11 12:26             ` Liviu Dudau
2016-01-11 12:26             ` Liviu Dudau
2016-01-11 13:49             ` Arnd Bergmann
2016-01-11 13:49               ` Arnd Bergmann
2016-01-11 13:49               ` Arnd Bergmann
2016-01-11 14:14               ` Liviu Dudau
2016-01-11 14:14                 ` Liviu Dudau
2016-01-11 14:14                 ` Liviu Dudau
2016-01-04  8:27 ` [PATCH] drm: arm-hdlcd: remove DMA_CMA select Thierry Reding
2016-01-04  8:27   ` Thierry Reding
2016-01-04  8:27   ` Thierry Reding
2016-01-11 10:37 ` Liviu Dudau
2016-01-11 10:37   ` Liviu Dudau
2016-01-11 10:37   ` Liviu Dudau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2621741.YulfsnvZOh@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.