* [PATCH 0/2] PM: Fix build warnings for unusual configs
@ 2012-07-11 20:47 Rafael J. Wysocki
2012-07-11 20:48 ` [PATCH 1/2] PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset Rafael J. Wysocki
2012-07-11 20:49 ` [PATCH 2/2] PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset Rafael J. Wysocki
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-07-11 20:47 UTC (permalink / raw)
To: Linux PM list; +Cc: LKML
Hi all,
The following two patches fix build warnings for unusual combinations of
.config options.
[1/2] Fix build warnings in drivers/base/power/domain.c for CONFIG_PM_RUNTIME
unset.
[2/2] Fix build warning in drivers/base/power/sysfs.c for CONFIG_PM_SLEEP unset.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset
2012-07-11 20:47 [PATCH 0/2] PM: Fix build warnings for unusual configs Rafael J. Wysocki
@ 2012-07-11 20:48 ` Rafael J. Wysocki
2012-07-11 20:49 ` [PATCH 2/2] PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-07-11 20:48 UTC (permalink / raw)
To: Linux PM list; +Cc: LKML
From: Rafael J. Wysocki <rjw@sisk.pl>
The functions genpd_save_dev() and genpd_restore_dev() are not used
for CONFIG_PM_RUNTIME unset, so move them under an appropriate
#ifdef.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/domain.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
Index: linux/drivers/base/power/domain.c
===================================================================
--- linux.orig/drivers/base/power/domain.c
+++ linux/drivers/base/power/domain.c
@@ -75,19 +75,6 @@ static int genpd_start_dev(struct generi
start_latency_ns, "start");
}
-static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
- return GENPD_DEV_TIMED_CALLBACK(genpd, int, save_state, dev,
- save_state_latency_ns, "state save");
-}
-
-static int genpd_restore_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
- return GENPD_DEV_TIMED_CALLBACK(genpd, int, restore_state, dev,
- restore_state_latency_ns,
- "state restore");
-}
-
static bool genpd_sd_counter_dec(struct generic_pm_domain *genpd)
{
bool ret = false;
@@ -275,6 +262,19 @@ int pm_genpd_poweron(struct generic_pm_d
#ifdef CONFIG_PM_RUNTIME
+static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev)
+{
+ return GENPD_DEV_TIMED_CALLBACK(genpd, int, save_state, dev,
+ save_state_latency_ns, "state save");
+}
+
+static int genpd_restore_dev(struct generic_pm_domain *genpd, struct device *dev)
+{
+ return GENPD_DEV_TIMED_CALLBACK(genpd, int, restore_state, dev,
+ restore_state_latency_ns,
+ "state restore");
+}
+
static int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
unsigned long val, void *ptr)
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset
2012-07-11 20:47 [PATCH 0/2] PM: Fix build warnings for unusual configs Rafael J. Wysocki
2012-07-11 20:48 ` [PATCH 1/2] PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset Rafael J. Wysocki
@ 2012-07-11 20:49 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-07-11 20:49 UTC (permalink / raw)
To: Linux PM list; +Cc: LKML
From: Rafael J. Wysocki <rjw@sisk.pl>
The power/async device sysfs attribute is only used if both
CONFIG_PM_ADVANCED_DEBUG and CONFIG_PM_SLEEP are set, but the code
implementing it doesn't depend on CONFIG_PM_SLEEP. As a result, a
build warning appears if CONFIG_PM_ADVANCED_DEBUG is set and
CONFIG_PM_SLEEP is not set.
Fix it by adding a #ifdef CONFIG_PM_SLEEP around the code in
question.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/sysfs.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux/drivers/base/power/sysfs.c
===================================================================
--- linux.orig/drivers/base/power/sysfs.c
+++ linux/drivers/base/power/sysfs.c
@@ -474,6 +474,8 @@ static DEVICE_ATTR(runtime_enabled, 0444
#endif
+#ifdef CONFIG_PM_SLEEP
+
static ssize_t async_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
@@ -500,6 +502,8 @@ static ssize_t async_store(struct device
}
static DEVICE_ATTR(async, 0644, async_show, async_store);
+
+#endif
#endif /* CONFIG_PM_ADVANCED_DEBUG */
static struct attribute *power_attrs[] = {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-11 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 20:47 [PATCH 0/2] PM: Fix build warnings for unusual configs Rafael J. Wysocki
2012-07-11 20:48 ` [PATCH 1/2] PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset Rafael J. Wysocki
2012-07-11 20:49 ` [PATCH 2/2] PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®