summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorFengguang Wu <wfg@mail.ustc.edu.cn>2007-10-20 04:26:04 +0400
committerAdrian Bunk <bunk@kernel.org>2007-10-20 04:26:04 +0400
commitdf7c487250b17aa0caeee7d85f120330f1d31355 (patch)
treebce0b3c04706ba89e410a22cc9c370086e931693 /kernel/power
parent963151297328eea39933bda23959ce5319e99fb7 (diff)
downloadlinux-df7c487250b17aa0caeee7d85f120330f1d31355.tar.xz
trivial copy_data_pages() tidy up
Change the loop style of copy_data_pages() to remove a duplicate condition. Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/snapshot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index ccc95ac07bed..78039b477d2b 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1005,11 +1005,12 @@ copy_data_pages(struct memory_bitmap *copy_bm, struct memory_bitmap *orig_bm)
}
memory_bm_position_reset(orig_bm);
memory_bm_position_reset(copy_bm);
- do {
+ for(;;) {
pfn = memory_bm_next_pfn(orig_bm);
- if (likely(pfn != BM_END_OF_MAP))
- copy_data_page(memory_bm_next_pfn(copy_bm), pfn);
- } while (pfn != BM_END_OF_MAP);
+ if (unlikely(pfn == BM_END_OF_MAP))
+ break;
+ copy_data_page(memory_bm_next_pfn(copy_bm), pfn);
+ }
}
/* Total number of image pages */