trivial copy_data_pages() tidy up
authorFengguang Wu <wfg@mail.ustc.edu.cn>
Sat, 20 Oct 2007 00:26:04 +0000 (02:26 +0200)
committerAdrian Bunk <bunk@kernel.org>
Sat, 20 Oct 2007 00:26:04 +0000 (02:26 +0200)
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>
kernel/power/snapshot.c

index ccc95ac07bedbc8cbfed19b06a3eca9848b11723..78039b477d2bd7bbae3ab893763111475ea932a6 100644 (file)
@@ -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 */