diff options
author | Hao Ge <gehao@kylinos.cn> | 2024-07-29 10:04:31 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-09-02 05:25:56 +0200 |
commit | 5c0532500f102ae8f80be122223eb692ca1d6721 (patch) | |
tree | 401d5fe60d19897e2e93431e5be0f7e1e81831db /mm/cma.c | |
parent | mm: improve code consistency with zonelist_* helper functions (diff) | |
download | linux-5c0532500f102ae8f80be122223eb692ca1d6721.tar.xz linux-5c0532500f102ae8f80be122223eb692ca1d6721.zip |
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.dev
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/cma.c')
-rw-r--r-- | mm/cma.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; *res_cma = cma; cma_area_count++; - totalcma_pages += (size / PAGE_SIZE); + totalcma_pages += cma->count; return 0; } |