From: Li kunyu <kunyu@nfschina.com>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, hpa@zytor.com,
rafael.j.wysocki@intel.com, tony.luck@intel.com,
tim.c.chen@linux.intel.com, tim.gardner@canonical.com,
boris.ostrovsky@oracle.com
Cc: peterz@infradead.org, ray.huang@amd.com, paulmck@kernel.org,
ionela.voinescu@arm.com, linux-kernel@vger.kernel.org,
Li kunyu <kunyu@nfschina.com>
Subject: [PATCH] x86: topology_update_package_map function doesn't use the return value
Date: Mon, 6 Jun 2022 20:23:16 +0800 [thread overview]
Message-ID: <20220606122316.291022-1-kunyu@nfschina.com> (raw)
topology_update_package_map function could remove the return value, and
it could remove the BUG_ON check.
Signed-off-by: Li kunyu <kunyu@nfschina.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 458c891a8273..eabfb44b63ed 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -136,7 +136,7 @@ static inline int topology_max_smt_threads(void)
return __max_smt_threads;
}
-int topology_update_package_map(unsigned int apicid, unsigned int cpu);
+void topology_update_package_map(unsigned int apicid, 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_die(unsigned int die, unsigned int cpu);
@@ -144,8 +144,8 @@ bool topology_is_primary_thread(unsigned int cpu);
bool topology_smt_supported(void);
#else
#define topology_max_packages() (1)
-static inline int
-topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; }
+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 int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; }
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index c296cb1c0113..22d19a1feafd 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1673,7 +1673,7 @@ static void validate_apic_and_package_id(struct cpuinfo_x86 *c)
pr_err(FW_BUG "CPU%u: APIC id mismatch. Firmware: %x APIC: %x\n",
cpu, apicid, c->initial_apicid);
}
- BUG_ON(topology_update_package_map(c->phys_proc_id, cpu));
+ topology_update_package_map(c->phys_proc_id, cpu);
BUG_ON(topology_update_die_map(c->cpu_die_id, cpu));
#else
c->logical_proc_id = 0;
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 5e7f9532a10d..20c67cca245b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -327,7 +327,7 @@ EXPORT_SYMBOL(topology_phys_to_logical_die);
* @pkg: The physical package id as retrieved via CPUID
* @cpu: The cpu for which this is updated
*/
-int topology_update_package_map(unsigned int pkg, unsigned int cpu)
+void topology_update_package_map(unsigned int pkg, unsigned int cpu)
{
int new;
@@ -343,7 +343,6 @@ int topology_update_package_map(unsigned int pkg, unsigned int cpu)
}
found:
cpu_data(cpu).logical_proc_id = new;
- return 0;
}
/**
* topology_update_die_map - Update the physical to logical die map
--
2.18.2
next reply other threads:[~2022-06-06 12:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 12:23 Li kunyu [this message]
2022-06-07 17:44 ` Tim Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220606122316.291022-1-kunyu@nfschina.com \
--to=kunyu@nfschina.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=ionela.voinescu@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=ray.huang@amd.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=tim.gardner@canonical.com \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®