Commit ff7ed9e4 authored by Miaohe Lin's avatar Miaohe Lin Committed by Linus Torvalds

mm/page_alloc.c: simplify the code by using macro K()

Use helper macro K() to convert the pages to the corresponding size.
Minor readability improvement.

Link: https://lkml.kernel.org/r/20210902121242.41607-3-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ea808b4e
...@@ -8130,8 +8130,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char ...@@ -8130,8 +8130,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char
} }
if (pages && s) if (pages && s)
pr_info("Freeing %s memory: %ldK\n", pr_info("Freeing %s memory: %ldK\n", s, K(pages));
s, pages << (PAGE_SHIFT - 10));
return pages; return pages;
} }
...@@ -8176,14 +8175,13 @@ void __init mem_init_print_info(void) ...@@ -8176,14 +8175,13 @@ void __init mem_init_print_info(void)
", %luK highmem" ", %luK highmem"
#endif #endif
")\n", ")\n",
nr_free_pages() << (PAGE_SHIFT - 10), K(nr_free_pages()), K(physpages),
physpages << (PAGE_SHIFT - 10),
codesize >> 10, datasize >> 10, rosize >> 10, codesize >> 10, datasize >> 10, rosize >> 10,
(init_data_size + init_code_size) >> 10, bss_size >> 10, (init_data_size + init_code_size) >> 10, bss_size >> 10,
(physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10), K(physpages - totalram_pages() - totalcma_pages),
totalcma_pages << (PAGE_SHIFT - 10) K(totalcma_pages)
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
, totalhigh_pages() << (PAGE_SHIFT - 10) , K(totalhigh_pages())
#endif #endif
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment