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-next>] [day] [month] [year] [list]
Message-Id: <1450266099-4352-1-git-send-email-sudipm.mukherjee@gmail.com>
Date:	Wed, 16 Dec 2015 17:11:39 +0530
From:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>
Cc:	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Eric Anholt <eric@...olt.net>
Subject: [PATCH] PM / sleep: define inline functions

If CONFIG_PM_SLEEP is not defined then the functions are defined as
NULL. And as a result we are getting build failure with
alpha allmodconfig with the error:

drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power':
include/linux/stddef.h:7:14: error: called object is not a function or function pointer
 #define NULL ((void *)0)
              ^
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);
          ^
include/linux/stddef.h:7:14: error: called object is not a function or function pointer
 #define NULL ((void *)0)
              ^
include/linux/pm.h:764:28: note: in expansion of macro 'NULL'
 #define pm_generic_resume  NULL
                            ^
drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume'
   return pm_generic_resume(&vc4->v3d->pdev->dev);
          ^

Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
Cc: Eric Anholt <eric@...olt.net>
Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
---

build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/97149763

Also tested with x86_64 allmodconfig.

 include/linux/pm.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index 528be67..5fe5dbb 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -755,13 +755,22 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void
 {
 }
 
+static inline int pm_generic_resume(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pm_generic_poweroff(struct device *dev)
+{
+	return 0;
+}
+
 #define pm_generic_prepare		NULL
 #define pm_generic_suspend_late		NULL
 #define pm_generic_suspend_noirq	NULL
 #define pm_generic_suspend		NULL
 #define pm_generic_resume_early		NULL
 #define pm_generic_resume_noirq		NULL
-#define pm_generic_resume		NULL
 #define pm_generic_freeze_noirq		NULL
 #define pm_generic_freeze_late		NULL
 #define pm_generic_freeze		NULL
@@ -773,7 +782,6 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void
 #define pm_generic_restore		NULL
 #define pm_generic_poweroff_noirq	NULL
 #define pm_generic_poweroff_late	NULL
-#define pm_generic_poweroff		NULL
 #define pm_generic_complete		NULL
 #endif /* !CONFIG_PM_SLEEP */
 
-- 
1.9.1

--
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