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: <20230607063900.GD52412@kernel.org>
Date:   Wed, 7 Jun 2023 09:39:00 +0300
From:   Mike Rapoport <rppt@...nel.org>
To:     Haifeng Xu <haifeng.xu@...pee.com>
Cc:     mhocko@...nel.org, akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/mm_init.c: drop 'nid' parameter from
 check_for_memory()

On Wed, Jun 07, 2023 at 03:24:02AM +0000, Haifeng Xu wrote:
> The node_id in pgdat has already been set in free_area_init_node(),
> so use it internally instead of passing a redundant parameter.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@...pee.com>

Reviewed-by: Mike Rapoport (IBM) <rppt@...nel.org>

> ---
>  mm/mm_init.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index b82718d596c3..78e67041ae9f 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -1725,7 +1725,7 @@ static void __init free_area_init_node(int nid)
>  }
>  
>  /* Any regular or high memory on that node ? */
> -static void check_for_memory(pg_data_t *pgdat, int nid)
> +static void check_for_memory(pg_data_t *pgdat)
>  {
>  	enum zone_type zone_type;
>  
> @@ -1733,9 +1733,9 @@ static void check_for_memory(pg_data_t *pgdat, int nid)
>  		struct zone *zone = &pgdat->node_zones[zone_type];
>  		if (populated_zone(zone)) {
>  			if (IS_ENABLED(CONFIG_HIGHMEM))
> -				node_set_state(nid, N_HIGH_MEMORY);
> +				node_set_state(pgdat->node_id, N_HIGH_MEMORY);
>  			if (zone_type <= ZONE_NORMAL)
> -				node_set_state(nid, N_NORMAL_MEMORY);
> +				node_set_state(pgdat->node_id, N_NORMAL_MEMORY);
>  			break;
>  		}
>  	}
> @@ -1887,7 +1887,7 @@ void __init free_area_init(unsigned long *max_zone_pfn)
>  		/* Any memory on that node */
>  		if (pgdat->node_present_pages)
>  			node_set_state(nid, N_MEMORY);
> -		check_for_memory(pgdat, nid);
> +		check_for_memory(pgdat);
>  	}
>  
>  	memmap_init();
> -- 
> 2.25.1
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ