diff mbox series

[5/7] mm/nommu.c: use helper macro K()

Message ID 20230804012559.2617515-6-zhangpeng362@huawei.com (mailing list archive)
State New
Headers show
Series cleanup with helper macro K() | expand

Commit Message

Peng Zhang Aug. 4, 2023, 1:25 a.m. UTC
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(-)

Comments

David Hildenbrand Aug. 7, 2023, 3:19 p.m. UTC | #1
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 mbox series

Patch

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;