Commit 5c053250 authored by Hao Ge's avatar Hao Ge Committed by Andrew Morton

mm/cma: change the addition of totalcma_pages in the cma_init_reserved_mem

Replace the unnecessary division calculation with cma->count when update
the value of totalcma_pages.

Link: https://lkml.kernel.org/r/20240729080431.70916-1-hao.ge@linux.devSigned-off-by: default avatarHao Ge <gehao@kylinos.cn>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 29943248
...@@ -202,7 +202,7 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, ...@@ -202,7 +202,7 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,
cma->order_per_bit = order_per_bit; cma->order_per_bit = order_per_bit;
*res_cma = cma; *res_cma = cma;
cma_area_count++; cma_area_count++;
totalcma_pages += (size / PAGE_SIZE); totalcma_pages += cma->count;
return 0; return 0;
} }
......
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