mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Ming Lei <ming.lei@canonical.com>
Subject: [PATCH] PM: save 8bytes in 'struct dev_pm_info'
Date: Tue,  7 Aug 2012 10:57:58 +0800	[thread overview]
Message-ID: <1344308278-23211-1-git-send-email-ming.lei@canonical.com> (raw)

On ARMv7, sizeof(struct dev_pm_info) becomes 344Bytes from 352Bytes
after applying the patch which only changes fields' order, so we can
save 8bytes per device. Nothing in behaviour changed.

GCC: gcc version 4.5.1

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 include/linux/pm.h |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index f067e60..f116d40 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -505,11 +505,6 @@ struct pm_subsys_data {
 
 struct dev_pm_info {
 	pm_message_t		power_state;
-	unsigned int		can_wakeup:1;
-	unsigned int		async_suspend:1;
-	bool			is_prepared:1;	/* Owned by the PM core */
-	bool			is_suspended:1;	/* Ditto */
-	bool			ignore_children:1;
 	spinlock_t		lock;
 #ifdef CONFIG_PM_SLEEP
 	struct list_head	entry;
@@ -519,13 +514,12 @@ struct dev_pm_info {
 #else
 	unsigned int		should_wakeup:1;
 #endif
+	unsigned int		can_wakeup:1;
+	unsigned int		async_suspend:1;
+	bool			is_prepared:1;	/* Owned by the PM core */
+	bool			is_suspended:1;	/* Ditto */
+	bool			ignore_children:1;
 #ifdef CONFIG_PM_RUNTIME
-	struct timer_list	suspend_timer;
-	unsigned long		timer_expires;
-	struct work_struct	work;
-	wait_queue_head_t	wait_queue;
-	atomic_t		usage_count;
-	atomic_t		child_count;
 	unsigned int		disable_depth:3;
 	unsigned int		idle_notification:1;
 	unsigned int		request_pending:1;
@@ -538,6 +532,12 @@ struct dev_pm_info {
 	unsigned int		timer_autosuspends:1;
 	enum rpm_request	request;
 	enum rpm_status		runtime_status;
+	struct timer_list	suspend_timer;
+	unsigned long		timer_expires;
+	struct work_struct	work;
+	wait_queue_head_t	wait_queue;
+	atomic_t		usage_count;
+	atomic_t		child_count;
 	int			runtime_error;
 	int			autosuspend_delay;
 	unsigned long		last_busy;
-- 
1.7.9.5


             reply	other threads:[~2012-08-07  2:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07  2:57 Ming Lei [this message]
2012-08-07 11:27 ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344308278-23211-1-git-send-email-ming.lei@canonical.com \
    --to=ming.lei@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®