aboutsummaryrefslogtreecommitdiffstats
path: root/mm/numa.c
diff options
context:
space:
mode:
authorYe Liu <[email protected]>2025-04-27 10:04:42 +0000
committerAndrew Morton <[email protected]>2025-05-13 06:50:38 +0000
commita4b79af6c74c581f3f559bde8ae580a0545cfc96 (patch)
tree35bd21551fe264c25a3a71e4d8f387fb4185f10c /mm/numa.c
parentmm/debug_page_alloc: improve error message for invalid guardpage minorder (diff)
downloadkernel-a4b79af6c74c581f3f559bde8ae580a0545cfc96.tar.gz
kernel-a4b79af6c74c581f3f559bde8ae580a0545cfc96.zip
mm/numa: remove unnecessary local variable in alloc_node_data()
The temporary local variable 'nd' is redundant. Directly assign the virtual address to node_data[nid] to simplify the code. No functional change. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ye Liu <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Mike Rapoport (Microsoft) <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Cc: Liam Howlett <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/numa.c')
-rw-r--r--mm/numa.c4
1 files changed, 1 insertions, 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));
}