Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/20250427100442.958352-4-ye.liu@linux.dev
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Ye Liu and committed by
Andrew Morton
a4b79af6 4048774e

+1 -3
+1 -3
mm/numa.c
··· 13 13 { 14 14 const size_t nd_size = roundup(sizeof(pg_data_t), SMP_CACHE_BYTES); 15 15 u64 nd_pa; 16 - void *nd; 17 16 int tnid; 18 17 19 18 /* Allocate node data. Try node-local memory and then any node. */ ··· 20 21 if (!nd_pa) 21 22 panic("Cannot allocate %zu bytes for node %d data\n", 22 23 nd_size, nid); 23 - nd = __va(nd_pa); 24 24 25 25 /* report and initialize */ 26 26 pr_info("NODE_DATA(%d) allocated [mem %#010Lx-%#010Lx]\n", nid, ··· 28 30 if (tnid != nid) 29 31 pr_info(" NODE_DATA(%d) on node %d\n", nid, tnid); 30 32 31 - node_data[nid] = nd; 33 + node_data[nid] = __va(nd_pa); 32 34 memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); 33 35 } 34 36