Commit 5107e3eb authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Peter Zijlstra

x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die()

Make topology_phys_to_logical_pkg_die() static as it's only used in
smpboot.c and fixup the kernel-doc warnings for both functions.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarMichael Kelley <mikelley@microsoft.com>
Tested-by: default avatarOleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Helge Deller <deller@gmx.de> # parisc
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
Link: https://lore.kernel.org/r/20230512205255.493750666@linutronix.de
parent f1fcbaa1
...@@ -139,7 +139,6 @@ static inline int topology_max_smt_threads(void) ...@@ -139,7 +139,6 @@ static inline int topology_max_smt_threads(void)
int topology_update_package_map(unsigned int apicid, unsigned int cpu); int topology_update_package_map(unsigned int apicid, unsigned int cpu);
int topology_update_die_map(unsigned int dieid, unsigned int cpu); int topology_update_die_map(unsigned int dieid, unsigned int cpu);
int topology_phys_to_logical_pkg(unsigned int pkg); int topology_phys_to_logical_pkg(unsigned int pkg);
int topology_phys_to_logical_die(unsigned int die, unsigned int cpu);
bool topology_is_primary_thread(unsigned int cpu); bool topology_is_primary_thread(unsigned int cpu);
bool topology_smt_supported(void); bool topology_smt_supported(void);
#else #else
...@@ -149,8 +148,6 @@ topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; } ...@@ -149,8 +148,6 @@ topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; }
static inline int static inline int
topology_update_die_map(unsigned int dieid, unsigned int cpu) { return 0; } topology_update_die_map(unsigned int dieid, unsigned int cpu) { return 0; }
static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; }
static inline int topology_phys_to_logical_die(unsigned int die,
unsigned int cpu) { return 0; }
static inline int topology_max_die_per_package(void) { return 1; } static inline int topology_max_die_per_package(void) { return 1; }
static inline int topology_max_smt_threads(void) { return 1; } static inline int topology_max_smt_threads(void) { return 1; }
static inline bool topology_is_primary_thread(unsigned int cpu) { return true; } static inline bool topology_is_primary_thread(unsigned int cpu) { return true; }
......
...@@ -288,6 +288,7 @@ bool topology_smt_supported(void) ...@@ -288,6 +288,7 @@ bool topology_smt_supported(void)
/** /**
* topology_phys_to_logical_pkg - Map a physical package id to a logical * topology_phys_to_logical_pkg - Map a physical package id to a logical
* @phys_pkg: The physical package id to map
* *
* Returns logical package id or -1 if not found * Returns logical package id or -1 if not found
*/ */
...@@ -304,15 +305,17 @@ int topology_phys_to_logical_pkg(unsigned int phys_pkg) ...@@ -304,15 +305,17 @@ int topology_phys_to_logical_pkg(unsigned int phys_pkg)
return -1; return -1;
} }
EXPORT_SYMBOL(topology_phys_to_logical_pkg); EXPORT_SYMBOL(topology_phys_to_logical_pkg);
/** /**
* topology_phys_to_logical_die - Map a physical die id to logical * topology_phys_to_logical_die - Map a physical die id to logical
* @die_id: The physical die id to map
* @cur_cpu: The CPU for which the mapping is done
* *
* Returns logical die id or -1 if not found * Returns logical die id or -1 if not found
*/ */
int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu) static int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu)
{ {
int cpu; int cpu, proc_id = cpu_data(cur_cpu).phys_proc_id;
int proc_id = cpu_data(cur_cpu).phys_proc_id;
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
struct cpuinfo_x86 *c = &cpu_data(cpu); struct cpuinfo_x86 *c = &cpu_data(cpu);
...@@ -323,7 +326,6 @@ int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu) ...@@ -323,7 +326,6 @@ int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu)
} }
return -1; return -1;
} }
EXPORT_SYMBOL(topology_phys_to_logical_die);
/** /**
* topology_update_package_map - Update the physical to logical package map * topology_update_package_map - Update the physical to logical package map
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment