* [PATCH 0/2/ PM: Core device suspend/resume code cleanups
@ 2009-12-13 22:06 Rafael J. Wysocki
2009-12-13 22:08 ` [PATCH 1/2] PM: Remove unnecessary goto from device_resume_noirq() Rafael J. Wysocki
2009-12-13 22:09 ` [PATCH 2/2] PM: rwsem.h need not be included into main.c Rafael J. Wysocki
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2009-12-13 22:06 UTC (permalink / raw)
To: pm list; +Cc: LKML
Hi,
The following two patches clean up the core suspend/resume code a bit.
I hope no one will have any objections to them, as I'd like to include them in
my next pull request.
Please review.
Rafael
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] PM: Remove unnecessary goto from device_resume_noirq()
2009-12-13 22:06 [PATCH 0/2/ PM: Core device suspend/resume code cleanups Rafael J. Wysocki
@ 2009-12-13 22:08 ` Rafael J. Wysocki
2009-12-13 22:09 ` [PATCH 2/2] PM: rwsem.h need not be included into main.c Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2009-12-13 22:08 UTC (permalink / raw)
To: pm list; +Cc: LKML
From: Rafael J. Wysocki <rjw@sisk.pl>
In device_resume_noirq() there is the 'End' label and the associated
goto statement that aren't strictly necessary, so rework the code to
get rid of them. Also modify device_suspend_noirq() so that it looks
completely analogous to device_resume_noirq().
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/main.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
Index: linux-2.6/drivers/base/power/main.c
===================================================================
--- linux-2.6.orig/drivers/base/power/main.c
+++ linux-2.6/drivers/base/power/main.c
@@ -372,14 +372,11 @@ static int device_resume_noirq(struct de
TRACE_DEVICE(dev);
TRACE_RESUME(0);
- if (!dev->bus)
- goto End;
-
- if (dev->bus->pm) {
+ if (dev->bus && dev->bus->pm) {
pm_dev_dbg(dev, state, "EARLY ");
error = pm_noirq_op(dev, dev->bus->pm, state);
}
- End:
+
TRACE_RESUME(error);
return error;
}
@@ -615,10 +612,7 @@ static int device_suspend_noirq(struct d
{
int error = 0;
- if (!dev->bus)
- return 0;
-
- if (dev->bus->pm) {
+ if (dev->bus && dev->bus->pm) {
pm_dev_dbg(dev, state, "LATE ");
error = pm_noirq_op(dev, dev->bus->pm, state);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] PM: rwsem.h need not be included into main.c
2009-12-13 22:06 [PATCH 0/2/ PM: Core device suspend/resume code cleanups Rafael J. Wysocki
2009-12-13 22:08 ` [PATCH 1/2] PM: Remove unnecessary goto from device_resume_noirq() Rafael J. Wysocki
@ 2009-12-13 22:09 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2009-12-13 22:09 UTC (permalink / raw)
To: pm list; +Cc: LKML
From: Rafael J. Wysocki <rjw@sisk.pl>
It is not necessary to include <linux/rwsem.h> into
drivers/base/power/main.c, so don't do that.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/main.c | 1 -
1 file changed, 1 deletion(-)
Index: linux-2.6/drivers/base/power/main.c
===================================================================
--- linux-2.6.orig/drivers/base/power/main.c
+++ linux-2.6/drivers/base/power/main.c
@@ -23,7 +23,6 @@
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/resume-trace.h>
-#include <linux/rwsem.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-13 22:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-13 22:06 [PATCH 0/2/ PM: Core device suspend/resume code cleanups Rafael J. Wysocki
2009-12-13 22:08 ` [PATCH 1/2] PM: Remove unnecessary goto from device_resume_noirq() Rafael J. Wysocki
2009-12-13 22:09 ` [PATCH 2/2] PM: rwsem.h need not be included into main.c 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®