From: Mike Rapoport <rppt@kernel.org>
To: Ye Liu <ye.liu@linux.dev>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, david@redhat.com, harry.yoo@oracle.com,
riel@surriel.com, vbabka@suse.cz, liuye@kylinos.cn
Subject: Re: [PATCH 3/3] mm/numa: remove unnecessary local variable in alloc_node_data()
Date: Tue, 29 Apr 2025 09:32:25 +0300 [thread overview]
Message-ID: <aBByeY7ck9H4YOaE@kernel.org> (raw)
In-Reply-To: <20250427100442.958352-4-ye.liu@linux.dev>
On Sun, Apr 27, 2025 at 06:04:42PM +0800, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
>
> The temporary local variable 'nd' is redundant. Directly assign the
> virtual address to node_data[nid] to simplify the code.
>
> No functional change.
>
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> mm/numa.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/numa.c b/mm/numa.c
> index f1787d7713a6..7d5e06fe5bd4 100644
> --- a/mm/numa.c
> +++ b/mm/numa.c
> @@ -13,7 +13,6 @@ void __init alloc_node_data(int nid)
> {
> const size_t nd_size = roundup(sizeof(pg_data_t), SMP_CACHE_BYTES);
> u64 nd_pa;
> - void *nd;
> int tnid;
>
> /* Allocate node data. Try node-local memory and then any node. */
> @@ -21,7 +20,6 @@ void __init alloc_node_data(int nid)
> if (!nd_pa)
> panic("Cannot allocate %zu bytes for node %d data\n",
> nd_size, nid);
> - nd = __va(nd_pa);
>
> /* report and initialize */
> pr_info("NODE_DATA(%d) allocated [mem %#010Lx-%#010Lx]\n", nid,
> @@ -30,7 +28,7 @@ void __init alloc_node_data(int nid)
> if (tnid != nid)
> pr_info(" NODE_DATA(%d) on node %d\n", nid, tnid);
>
> - node_data[nid] = nd;
> + node_data[nid] = __va(nd_pa);
> memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
> }
>
> --
> 2.25.1
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2025-04-29 6:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 10:04 [PATCH 0/3] mm: small cleanups for io-mapping, debug_page_alloc and numa Ye Liu
2025-04-27 10:04 ` [PATCH 1/3] mm/io-mapping: precompute remap protection flags for clarity Ye Liu
2025-04-28 7:18 ` David Hildenbrand
2025-04-28 12:15 ` Anshuman Khandual
2025-04-29 6:33 ` Mike Rapoport
2025-04-27 10:04 ` [PATCH 2/3] mm/debug_page_alloc: improve error message for invalid guardpage minorder Ye Liu
2025-04-28 7:21 ` David Hildenbrand
2025-04-28 12:24 ` Anshuman Khandual
2025-04-29 7:29 ` Mike Rapoport
2025-04-27 10:04 ` [PATCH 3/3] mm/numa: remove unnecessary local variable in alloc_node_data() Ye Liu
2025-04-28 7:22 ` David Hildenbrand
2025-04-29 4:03 ` Anshuman Khandual
2025-04-29 6:32 ` Mike Rapoport [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBByeY7ck9H4YOaE@kernel.org \
--to=rppt@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=lorenzo.stoakes@oracle.com \
--cc=riel@surriel.com \
--cc=vbabka@suse.cz \
--cc=ye.liu@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox