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>] [day] [month] [year] [list]
Message-Id: <1452363214-969-1-git-send-email-linux@roeck-us.net>
Date:	Sat,  9 Jan 2016 10:13:34 -0800
From:	Guenter Roeck <linux@...ck-us.net>
To:	David Airlie <airlied@...ux.ie>
Cc:	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	Guenter Roeck <linux@...ck-us.net>,
	Eric Anholt <eric@...olt.net>
Subject: [PATCH -next] drm/vc4: Do not call pm functions if CONFIG_PM_SLEEP is not configured

If CONFIG_PM_SLEEP is not configured, the build fails with

include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
 #define pm_generic_poweroff  NULL

drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note:
	in expansion of macro 'pm_generic_poweroff'
  return pm_generic_poweroff(&vc4->v3d->pdev->dev);

pm_generic_poweroff and pm_generic_resume are defined as NULL if
CONFIG_PM_SLEEP is not configured and can therefore not be called
in that case. Create a wrapper for the calling function to solve
the problem.

Fixes: d5b1a78a772f1 ("drm/vc4: Add support for drawing 3D frames.")
Cc: Eric Anholt <eric@...olt.net>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
 drivers/gpu/drm/vc4/vc4_drv.h | 8 ++++++++
 drivers/gpu/drm/vc4/vc4_v3d.c | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index 080865ec2bae..5948e2b1b7d9 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -434,7 +434,15 @@ void vc4_plane_async_set_fb(struct drm_plane *plane,
 extern struct platform_driver vc4_v3d_driver;
 int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused);
 int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused);
+
+#ifdef CONFIG_PM_SLEEP
 int vc4_v3d_set_power(struct vc4_dev *vc4, bool on);
+#else
+static inline int vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
+{
+	return 0;
+}
+#endif
 
 /* vc4_validate.c */
 int
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 424d515ffcda..4789de303f2f 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -150,6 +150,8 @@ int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
  * This may be doable with just the clocks interface, though this
  * packet does some other register setup from the firmware, too.
  */
+#ifdef CONFIG_PM_SLEEP
+
 int
 vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
 {
@@ -159,6 +161,8 @@ vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
 		return pm_generic_resume(&vc4->v3d->pdev->dev);
 }
 
+#endif /* CONFIG_PM_SLEEP */
+
 static void vc4_v3d_init_hw(struct drm_device *dev)
 {
 	struct vc4_dev *vc4 = to_vc4_dev(dev);
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ