aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:03:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:35 -0400
commit0ed5fd138539940a493dc69359cb2f49de70ad89 (patch)
tree0c2efcb37db83a6fc4f11382d3c52492606cc377 /kernel
parent7ee3d4e8cd560500192d80ca84d7f15d6dee0807 (diff)
mm: use totalram_pages instead of num_physpages at runtime
The global variable num_physpages is scheduled to be removed, so use totalram_pages instead of num_physpages at runtime. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Miklos Szeredi <miklos@szeredi.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: James Morris <jmorris@namei.org> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: Patrick McHardy <kaber@trash.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/snapshot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 0de28576807d..8b5d1cd933f4 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1651,7 +1651,7 @@ unsigned long snapshot_get_image_size(void)
1651static int init_header(struct swsusp_info *info) 1651static int init_header(struct swsusp_info *info)
1652{ 1652{
1653 memset(info, 0, sizeof(struct swsusp_info)); 1653 memset(info, 0, sizeof(struct swsusp_info));
1654 info->num_physpages = num_physpages; 1654 info->num_physpages = get_num_physpages();
1655 info->image_pages = nr_copy_pages; 1655 info->image_pages = nr_copy_pages;
1656 info->pages = snapshot_get_image_size(); 1656 info->pages = snapshot_get_image_size();
1657 info->size = info->pages; 1657 info->size = info->pages;
@@ -1795,7 +1795,7 @@ static int check_header(struct swsusp_info *info)
1795 char *reason; 1795 char *reason;
1796 1796
1797 reason = check_image_kernel(info); 1797 reason = check_image_kernel(info);
1798 if (!reason && info->num_physpages != num_physpages) 1798 if (!reason && info->num_physpages != get_num_physpages())
1799 reason = "memory size"; 1799 reason = "memory size";
1800 if (reason) { 1800 if (reason) {
1801 printk(KERN_ERR "PM: Image mismatch: %s\n", reason); 1801 printk(KERN_ERR "PM: Image mismatch: %s\n", reason);