Skip to contentSkip to conversation

x86/cpu: Remove redundant CONFIG_NUMA guard around numa_add_cpu()

PATCH Applied Shivank Garg 2 participants 2 messages Nov 12, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cpu: Remove redundant CONFIG_NUMA guard around numa_add_cpu()

Remove unnecessary CONFIG_NUMA ifdef around numa_add_cpu() since the function is already properly handled in numa.h for both NUMA and non-NUMA configurations. For !CONFIG_NUMA builds, numa_add_cpu() is defined as an empty function.

Simplify the code without any functionality change.

Testing: Make CONFIG_NUMA=n build

---
 arch/x86/kernel/cpu/common.c | 2 --
 1 file changed, 2 deletions(-)
arch/x86/kernel/cpu/common.c +0 -2
index a5f221ea5688..e5b128fc8184 100644
@@ -1906,9 +1906,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
 	/* Init Machine Check Exception if available. */
 	mcheck_cpu_init(c);
 
-#ifdef CONFIG_NUMA
 	numa_add_cpu(smp_processor_id());
-#endif
 }
 
 /*
Signature · 1 line
2.34.1
merge bot Applied
#1 lore raw
The following commit has been merged into the x86/cpu branch of tip:

The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     f74642d81c24d9e69745cd0b75e1bddc81827606
Gitweb:        https://git.kernel.org/tip/f74642d81c24d9e69745cd0b75e1bddc81827606
Author:        Shivank Garg <[email protected]>
AuthorDate:    Tue, 12 Nov 2024 07:23:47 
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Tue, 12 Nov 2024 11:00:50 +01:00

x86/cpu: Remove redundant CONFIG_NUMA guard around numa_add_cpu()

Remove unnecessary CONFIG_NUMA #ifdef around numa_add_cpu() since the function is already properly handled in <asm/numa.h> for both NUMA and non-NUMA configurations. For !CONFIG_NUMA builds, numa_add_cpu() is defined as an empty function.

Simplify the code without any functionality change.

Testing: Build CONFIG_NUMA=n

---
 arch/x86/kernel/cpu/common.c | 2 --
 1 file changed, 2 deletions(-)
arch/x86/kernel/cpu/common.c +0 -2
index 07a34d7..59dc735 100644
@@ -1902,9 +1902,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
 	/* Init Machine Check Exception if available. */
 	mcheck_cpu_init(c);
 
-#ifdef CONFIG_NUMA
 	numa_add_cpu(smp_processor_id());
-#endif
 }
 
 /*