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] [day] [month] [year] [list]
Date:   Thu, 30 Apr 2020 10:31:53 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     Guixiong Wei <guixiongwei@...il.com>, catalin.marinas@....com,
        will@...nel.org
Cc:     steve.capper@....com, linux-kernel@...r.kernel.org,
        rppt@...ux.ibm.com, linux-arm-kernel@...ts.infradead.org,
        guro@...com, akpm@...ux-foundation.org, tglx@...utronix.de,
        nsaenzjulienne@...e.de
Subject: Re: [PATCH] arm: mm: use __pfn_to_section() to get mem_section



On 04/30/2020 09:34 AM, Guixiong Wei wrote:
> Use __pfn_to_section() to get mem_section, instead of open-coding it.

There is no open coding here. __pfn_to_section() helper which already
wraps around __nr_to_section(pfn_to_section_nr(pfn)), should be used
directly instead.

> No semantic changes.

and functional change. Please reword the commit message.

> 
> Signed-off-by: Guixiong Wei <guixiongwei@...il.com>
> ---
>  arch/arm64/mm/init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index e42727e3568e..d2df416b840e 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -272,7 +272,7 @@ int pfn_valid(unsigned long pfn)
>  	if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
>  		return 0;
>  
> -	if (!valid_section(__nr_to_section(pfn_to_section_nr(pfn))))
> +	if (!valid_section(__pfn_to_section(pfn))
Looks good.

>  		return 0;
>  #endif
>  	return memblock_is_map_memory(addr);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ