Message ID | 20230804012559.2617515-6-zhangpeng362@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | cleanup with helper macro K() | expand |
On 04.08.23 03:25, Peng Zhang wrote: > From: ZhangPeng <zhangpeng362@huawei.com> > > Use helper macro K() to improve code readability. No functional > modification involved. > > Signed-off-by: ZhangPeng <zhangpeng362@huawei.com> > --- > mm/nommu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/nommu.c b/mm/nommu.c > index 1fe0ee239860..8dba41cfc44d 100644 > --- a/mm/nommu.c > +++ b/mm/nommu.c > @@ -1800,7 +1800,7 @@ static int __meminit 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; > @@ -1821,7 +1821,7 @@ static int __meminit 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; Reviewed-by: David Hildenbrand <david@redhat.com>
diff --git a/mm/nommu.c b/mm/nommu.c index 1fe0ee239860..8dba41cfc44d 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1800,7 +1800,7 @@ static int __meminit 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; @@ -1821,7 +1821,7 @@ static int __meminit 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;