diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-09-20 13:44:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-10-16 19:57:42 -0400 |
commit | 266f1a25eff5ff98c498d7754a419aacfd88f71c (patch) | |
tree | 1666c23a92f3845be4644dc26728574119ca61f9 /kernel/power/snapshot.c | |
parent | bcb5ba8b4e8a5ae14b27351bdf499dd4c3bcc944 (diff) |
PM / Hibernate: Improve comments in hibernate_preallocate_memory()
One comment in hibernate_preallocate_memory() is wrong, so fix it and
add one more comment to clarify the meaning of the fixed one.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index d3f795f01bbc..d9191b40cf6e 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -1318,12 +1318,14 @@ int hibernate_preallocate_memory(void) | |||
1318 | 1318 | ||
1319 | /* Compute the maximum number of saveable pages to leave in memory. */ | 1319 | /* Compute the maximum number of saveable pages to leave in memory. */ |
1320 | max_size = (count - (size + PAGES_FOR_IO)) / 2 - 2 * SPARE_PAGES; | 1320 | max_size = (count - (size + PAGES_FOR_IO)) / 2 - 2 * SPARE_PAGES; |
1321 | /* Compute the desired number of image pages specified by image_size. */ | ||
1321 | size = DIV_ROUND_UP(image_size, PAGE_SIZE); | 1322 | size = DIV_ROUND_UP(image_size, PAGE_SIZE); |
1322 | if (size > max_size) | 1323 | if (size > max_size) |
1323 | size = max_size; | 1324 | size = max_size; |
1324 | /* | 1325 | /* |
1325 | * If the maximum is not less than the current number of saveable pages | 1326 | * If the desired number of image pages is at least as large as the |
1326 | * in memory, allocate page frames for the image and we're done. | 1327 | * current number of saveable pages in memory, allocate page frames for |
1328 | * the image and we're done. | ||
1327 | */ | 1329 | */ |
1328 | if (size >= saveable) { | 1330 | if (size >= saveable) { |
1329 | pages = preallocate_image_highmem(save_highmem); | 1331 | pages = preallocate_image_highmem(save_highmem); |