diff options
author | ZhangPeng <zhangpeng362@huawei.com> | 2023-08-04 09:25:58 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-08-21 13:37:45 -0700 |
commit | b1773e0ea30a46cf23238ff38d5ca4756c41ad2e (patch) | |
tree | 63b9c00e934189cc2a4091949e7d6e3c112c984a /mm | |
parent | d5a6474d3d36623b368c19dd3e9f5a09c6013120 (diff) | |
download | linux-starfive-b1773e0ea30a46cf23238ff38d5ca4756c41ad2e.tar.gz linux-starfive-b1773e0ea30a46cf23238ff38d5ca4756c41ad2e.tar.bz2 linux-starfive-b1773e0ea30a46cf23238ff38d5ca4756c41ad2e.zip |
mm/mmap.c: use helper macro K()
Use helper macro K() to improve code readability. No functional
modification involved.
Link: https://lkml.kernel.org/r/20230804012559.2617515-7-zhangpeng362@huawei.com
Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index bc91d91261ab..35b6bc9c7c95 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3785,7 +3785,7 @@ static int init_user_reserve(void) { unsigned long free_kbytes; - free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10); + free_kbytes = K(global_zone_page_state(NR_FREE_PAGES)); sysctl_user_reserve_kbytes = min(free_kbytes / 32, 1UL << 17); return 0; @@ -3806,7 +3806,7 @@ static int init_admin_reserve(void) { unsigned long free_kbytes; - free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10); + free_kbytes = K(global_zone_page_state(NR_FREE_PAGES)); sysctl_admin_reserve_kbytes = min(free_kbytes / 32, 1UL << 13); return 0; @@ -3850,7 +3850,7 @@ static int reserve_mem_notifier(struct notifier_block *nb, break; case MEM_OFFLINE: - free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10); + free_kbytes = K(global_zone_page_state(NR_FREE_PAGES)); if (sysctl_user_reserve_kbytes > free_kbytes) { init_user_reserve(); |