Skip to contentSkip to conversation

mm: Fix output of total_ram.

PATCH In review Tony Breeds 2 participants 2 messages Jul 5, 2011 – Jul 12, 2011 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: Fix output of total_ram.

On 32bit platforms that support >= 4GB memory total_ram was truncated. This creates a confusing printk:

	Top of RAM: 0x100000000, Total RAM: 0x0
Fix that:
	Top of RAM: 0x100000000, Total RAM: 0x100000000
---
 arch/powerpc/mm/mem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/mm/mem.c +2 -2
index 29d4dde..ac1c3d3 100644
@@ -249,7 +249,7 @@ static int __init mark_nonram_nosave(void)
  */
 void __init paging_init(void)
 {
-	unsigned long total_ram = memblock_phys_mem_size();
+	unsigned long long total_ram = memblock_phys_mem_size();
 	phys_addr_t top_of_ram = memblock_end_of_DRAM();
 	unsigned long max_zone_pfns[MAX_NR_ZONES];
 
@@ -269,7 +269,7 @@ void __init paging_init(void)
 	kmap_prot = PAGE_KERNEL;
 #endif /* CONFIG_HIGHMEM */
 
-	printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%lx\n",
+	printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n",
 	       (unsigned long long)top_of_ram, total_ram);
 	printk(KERN_DEBUG "Memory hole size: %ldMB\n",
 	       (long int)((top_of_ram - total_ram) >> 20));
Signature · 1 line
1.7.4.4