lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31f53542-e498-5428-053e-6a24bd23887b@redhat.com>
Date:   Tue, 31 Aug 2021 16:07:44 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Miaohe Lin <linmiaohe@...wei.com>, akpm@...ux-foundation.org
Cc:     vbabka@...e.cz, sfr@...b.auug.org.au, peterz@...radead.org,
        mgorman@...hsingularity.net, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] mm/page_alloc.c: simplify the code by using macro K()

On 30.08.21 16:10, Miaohe Lin wrote:
> Use helper macro K() to convert the pages to the corresponding size.
> Minor readability improvement.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
>   mm/page_alloc.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index dbb3338d9287..d3983244f56f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -8134,8 +8134,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char
>   	}
>   
>   	if (pages && s)
> -		pr_info("Freeing %s memory: %ldK\n",
> -			s, pages << (PAGE_SHIFT - 10));
> +		pr_info("Freeing %s memory: %ldK\n", s, K(pages));
>   
>   	return pages;
>   }
> @@ -8180,14 +8179,13 @@ void __init mem_init_print_info(void)
>   		", %luK highmem"
>   #endif
>   		")\n",
> -		nr_free_pages() << (PAGE_SHIFT - 10),
> -		physpages << (PAGE_SHIFT - 10),
> +		K(nr_free_pages()), K(physpages),
>   		codesize >> 10, datasize >> 10, rosize >> 10,
>   		(init_data_size + init_code_size) >> 10, bss_size >> 10,
> -		(physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10),
> -		totalcma_pages << (PAGE_SHIFT - 10)
> +		K(physpages - totalram_pages() - totalcma_pages),
> +		K(totalcma_pages)
>   #ifdef	CONFIG_HIGHMEM
> -		, totalhigh_pages() << (PAGE_SHIFT - 10)
> +		, K(totalhigh_pages())
>   #endif
>   		);
>   }
> 

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ