lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 01 Jan 2016 15:39:17 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	David Airlie <airlied@...ux.ie>, Liviu Dudau <liviu.dudau@....com>,
	linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: [PATCH 3/3] drm: arm-hdlcd: fix build warnings for !CONFIG_PM

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@...db.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;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ