summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/hibernate.c4
-rw-r--r--kernel/power/snapshot.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 31b665ba1..2444206e9 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -299,12 +299,12 @@ static int create_image(int platform_mode)
save_processor_state();
trace_suspend_resume(TPS("machine_suspend"), PM_EVENT_HIBERNATE, true);
error = swsusp_arch_suspend();
+ /* Restore control flow magically appears here */
+ restore_processor_state();
trace_suspend_resume(TPS("machine_suspend"), PM_EVENT_HIBERNATE, false);
if (error)
printk(KERN_ERR "PM: Error %d creating hibernation image\n",
error);
- /* Restore control flow magically appears here */
- restore_processor_state();
if (!in_suspend)
events_check_enabled = false;
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 542163a01..dc3bab15e 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -812,9 +812,9 @@ static bool memory_bm_pfn_present(struct memory_bitmap *bm, int index, unsigned
*/
static bool rtree_next_node(struct memory_bitmap *bm, int index)
{
- bm->cur[index].node = list_entry(bm->cur[index].node->list.next,
- struct rtree_node, list);
- if (&bm->cur[index].node->list != &bm->cur[index].zone->leaves) {
+ if (!list_is_last(&bm->cur[index].node->list, &bm->cur[index].zone->leaves)) {
+ bm->cur[index].node = list_entry(bm->cur[index].node->list.next,
+ struct rtree_node, list);
bm->cur[index].node_pfn += BM_BITS_PER_BLOCK;
bm->cur[index].node_bit = 0;
touch_softlockup_watchdog();
@@ -822,9 +822,9 @@ static bool rtree_next_node(struct memory_bitmap *bm, int index)
}
/* No more nodes, goto next zone */
- bm->cur[index].zone = list_entry(bm->cur[index].zone->list.next,
+ if (!list_is_last(&bm->cur[index].zone->list, &bm->zones)) {
+ bm->cur[index].zone = list_entry(bm->cur[index].zone->list.next,
struct mem_zone_bm_rtree, list);
- if (&bm->cur[index].zone->list != &bm->zones) {
bm->cur[index].node = list_entry(bm->cur[index].zone->leaves.next,
struct rtree_node, list);
bm->cur[index].node_pfn = 0;