[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1368119391-13837-2-git-send-email-linux@roeck-us.net>
Date: Thu, 9 May 2013 10:09:49 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: linux-pm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, lm-sensors@...sensors.org,
Jean Delvare <khali@...ux-fr.org>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Jingoo Han <jg1.han@...sung.com>,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH 1/3] pm: Introduce __pm to mark power management functions and data
By marking power management functions and data with __pm, #ifdef CONFIG_PM
and #ifdef CONFIG_PM_SLEEP is no longer necessary in most cases.
This ensures that the power management code still compiles even if power
management is disabled, but does not consume space in the object file.
As a side effect, drivers declaring struct dev_pm_ops unconditionally
get a bit smaller if CONFIG_PM_SLEEP is disabled.
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
include/linux/pm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/pm.h b/include/linux/pm.h
index fe70d9b..46df155 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -43,9 +43,11 @@ struct device;
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
#define pm_ops_ptr(_ptr) (_ptr)
+#define __pm
#else
#define power_group_name NULL
#define pm_ops_ptr(_ptr) NULL
+#define __pm __section(.discard)
#endif
typedef struct pm_message {
--
1.7.9.7
--
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