[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220607091610.495912-1-kunyu@nfschina.com>
Date: Tue, 7 Jun 2022 17:16:10 +0800
From: Li kunyu <kunyu@...china.com>
To: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com
Cc: ionela.voinescu@....com, linux-kernel@...r.kernel.org,
Li kunyu <kunyu@...china.com>
Subject: [PATCH] x86: topology_update_die_map function removes unused return values
Change the return value of the topology_update_die_map function to
void to remove the BUG_ON check and reduce eAX register calls.
Signed-off-by: Li kunyu <kunyu@...china.com>
---
arch/x86/include/asm/topology.h | 6 +++---
arch/x86/kernel/cpu/common.c | 2 +-
arch/x86/kernel/smpboot.c | 3 +--
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index eabfb44b63ed..b641f81cb61f 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -137,7 +137,7 @@ static inline int topology_max_smt_threads(void)
}
void topology_update_package_map(unsigned int apicid, unsigned int cpu);
-int topology_update_die_map(unsigned int dieid, unsigned int cpu);
+void topology_update_die_map(unsigned int dieid, unsigned int cpu);
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);
@@ -146,8 +146,8 @@ bool topology_smt_supported(void);
#define topology_max_packages() (1)
static inline void
topology_update_package_map(unsigned int apicid, unsigned int cpu) { }
-static inline int
-topology_update_die_map(unsigned int dieid, unsigned int cpu) { return 0; }
+static inline void
+topology_update_die_map(unsigned int dieid, unsigned int cpu) { }
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; }
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 22d19a1feafd..6850df297dfd 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1674,7 +1674,7 @@ static void validate_apic_and_package_id(struct cpuinfo_x86 *c)
cpu, apicid, c->initial_apicid);
}
topology_update_package_map(c->phys_proc_id, cpu);
- BUG_ON(topology_update_die_map(c->cpu_die_id, cpu));
+ topology_update_die_map(c->cpu_die_id, cpu);
#else
c->logical_proc_id = 0;
#endif
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 20c67cca245b..febec77252e8 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -349,7 +349,7 @@ void topology_update_package_map(unsigned int pkg, unsigned int cpu)
* @die: The die id as retrieved via CPUID
* @cpu: The cpu for which this is updated
*/
-int topology_update_die_map(unsigned int die, unsigned int cpu)
+void topology_update_die_map(unsigned int die, unsigned int cpu)
{
int new;
@@ -365,7 +365,6 @@ int topology_update_die_map(unsigned int die, unsigned int cpu)
}
found:
cpu_data(cpu).logical_die_id = new;
- return 0;
}
void __init smp_store_boot_cpu_info(void)
--
2.18.2
Powered by blists - more mailing lists