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]
Message-ID: <20231208093515.GN636165@kernel.org>
Date:   Fri, 8 Dec 2023 11:35:16 +0200
From:   Mike Rapoport <rppt@...nel.org>
To:     Yuntao Wang <ytcoode@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] memblock: Return NUMA_NO_NODE instead of -1 to improve
 code readability

On Thu, Dec 07, 2023 at 09:10:01PM +0800, Yuntao Wang wrote:
> When no corresponding memory region is found for the given pfn, return
> NUMA_NO_NODE instead of -1. This improves code readability and aligns with
> the existing logic of the memblock_search_pfn_nid() function's user.
> 
> Signed-off-by: Yuntao Wang <ytcoode@...il.com>

Applied, thanks!

> ---
>  mm/memblock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 5a88d6d24d79..c1f579c23396 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -1851,7 +1851,7 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
>  	int mid = memblock_search(type, PFN_PHYS(pfn));
>  
>  	if (mid == -1)
> -		return -1;
> +		return NUMA_NO_NODE;
>  
>  	*start_pfn = PFN_DOWN(type->regions[mid].base);
>  	*end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size);
> -- 
> 2.43.0
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ