Skip to contentSkip to conversation

ACPI: RISCV: Make acpi_numa_get_nid() to be static

PATCH Applied Hanjun Guo 3 participants 3 messages Aug 11, 2024 – Sep 17, 2024

Subsystems (2)
lore
Share & tools
lore

Hanjun Guo

author
#0 lore raw

PATCH 1/1 ACPI: RISCV: Make acpi_numa_get_nid() to be static

acpi_numa_get_nid() is only called in acpi_numa.c for riscv, no need to add it in head file, so make it static and remove related functions in the asm/acpi.h.

Spotted by doing some cleanup for arm64 ACPI.

---
 arch/riscv/include/asm/acpi.h | 2 --
 arch/riscv/kernel/acpi_numa.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/riscv/include/asm/acpi.h +0 -2
index e0a1f84404f3..6e13695120bc 100644
@@ -91,10 +91,8 @@ static inline void acpi_get_cbo_block_size(struct acpi_table_header *table,
 #endif /* CONFIG_ACPI */
 
 #ifdef CONFIG_ACPI_NUMA
-int acpi_numa_get_nid(unsigned int cpu);
 void acpi_map_cpus_to_nodes(void);
 #else
-static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
 static inline void acpi_map_cpus_to_nodes(void) { }
 #endif /* CONFIG_ACPI_NUMA */
 
arch/riscv/kernel/acpi_numa.c +1 -1
index 0231482d6946..a93c773b60e6 100644
@@ -30,7 +30,7 @@
 
 static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
 
-int __init acpi_numa_get_nid(unsigned int cpu)
+static int __init acpi_numa_get_nid(unsigned int cpu)
 {
 	return acpi_early_node_map[cpu];
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 41 lines

-----Original Message-----
From: Hanjun Guo <[email protected]>
Sent: Sunday, August 11, 2024 11:18 AM
To: Sunil V L <[email protected]>; Xu, Haibo1 <[email protected]>; Paul Walmsley <[email protected]>; Palmer Dabbelt <[email protected]>; Albert Ou <[email protected]>
Cc: Sudeep Holla <[email protected]>; Lorenzo Pieralisi <[email protected]>; Rafael J . Wysocki <[email protected]>; linux- [email protected]; [email protected]; Hanjun Guo <[email protected]>
Subject: [PATCH] ACPI: RISCV: Make acpi_numa_get_nid() to be static

acpi_numa_get_nid() is only called in acpi_numa.c for riscv, no need to add it in head file, so make it static and remove related functions in the asm/acpi.h.

Spotted by doing some cleanup for arm64 ACPI.

---
 arch/riscv/include/asm/acpi.h | 2 --
 arch/riscv/kernel/acpi_numa.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/riscv/include/asm/acpi.h index renamed from arch/riscv/include/asm/acpi.h +0 -0

e0a1f84404f3..6e13695120bc 100644

arch/riscv/include/asm/acpi.h +0 -0
@@ -91,10 +91,8 @@ static inline void acpi_get_cbo_block_size(struct

acpi_table_header *table, #endif /* CONFIG_ACPI */

#ifdef CONFIG_ACPI_NUMA
-int acpi_numa_get_nid(unsigned int cpu); void acpi_map_cpus_to_nodes(void); #else -static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; } static inline void acpi_map_cpus_to_nodes(void) { } #endif /* CONFIG_ACPI_NUMA */

arch/riscv/kernel/acpi_numa.c +0 -0
index 0231482d6946..a93c773b60e6 100644

arch/riscv/kernel/acpi_numa.c line 36

Quoted 8 lines
arch/riscv/kernel/acpi_numa.c +1 -1
@@ -30,7 +30,7 @@
 
 static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
 
-int __init acpi_numa_get_nid(unsigned int cpu)
+static int __init acpi_numa_get_nid(unsigned int cpu)
 {
 	return acpi_early_node_map[cpu];
 }

LGTM!

Quoted 2 lines

--
2.25.1

#2 lore raw
In reply to Hanjun Guo
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 9 lines · On Sun, 11 Aug 2024 11:18:04 +0800 you wrote:

acpi_numa_get_nid() is only called in acpi_numa.c for riscv, no need to add it in head file, so make it static and remove related functions in the asm/acpi.h.

Spotted by doing some cleanup for arm64 ACPI.

[...]

Here is the summary with links:
- ACPI: RISCV: Make acpi_numa_get_nid() to be static

    https://git.kernel.org/riscv/c/21d98d658f9e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html