* [PATCH] x86/apic: Delete useless BUG_ON in validate_apic_and_package_id()
@ 2024-03-08 8:01 Peng Liu
2024-03-08 8:51 ` Borislav Petkov
0 siblings, 1 reply; 2+ messages in thread
From: Peng Liu @ 2024-03-08 8:01 UTC (permalink / raw)
Cc: tglx, mingo, rick.p.edgecombe, daniel.sneddon, dave.hansen,
linux-kernel, x86, Peng Liu
Both topology_update_package_map() and topology_update_die_map() have a fixed
return value 0. That is, they never fail. So the BUG_ON() checks on them are
useless and better be deleted.
Signed-off-by: Peng Liu <pngliu@hotmail.com>
---
arch/x86/kernel/cpu/common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index fbc4e60d027c..44b08de3971c 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1796,8 +1796,8 @@ 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->topo.initial_apicid);
}
- BUG_ON(topology_update_package_map(c->topo.pkg_id, cpu));
- BUG_ON(topology_update_die_map(c->topo.die_id, cpu));
+ topology_update_package_map(c->topo.pkg_id, cpu);
+ topology_update_die_map(c->topo.die_id, cpu);
#else
c->topo.logical_pkg_id = 0;
#endif
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/apic: Delete useless BUG_ON in validate_apic_and_package_id()
2024-03-08 8:01 [PATCH] x86/apic: Delete useless BUG_ON in validate_apic_and_package_id() Peng Liu
@ 2024-03-08 8:51 ` Borislav Petkov
0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2024-03-08 8:51 UTC (permalink / raw)
To: Peng Liu
Cc: tglx, mingo, rick.p.edgecombe, daniel.sneddon, dave.hansen,
linux-kernel, x86
On Fri, Mar 08, 2024 at 04:01:52PM +0800, Peng Liu wrote:
> Both topology_update_package_map() and topology_update_die_map() have a fixed
> return value 0. That is, they never fail. So the BUG_ON() checks on them are
> useless and better be deleted.
>
> Signed-off-by: Peng Liu <pngliu@hotmail.com>
> ---
> arch/x86/kernel/cpu/common.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index fbc4e60d027c..44b08de3971c 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -1796,8 +1796,8 @@ 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->topo.initial_apicid);
> }
> - BUG_ON(topology_update_package_map(c->topo.pkg_id, cpu));
> - BUG_ON(topology_update_die_map(c->topo.die_id, cpu));
> + topology_update_package_map(c->topo.pkg_id, cpu);
> + topology_update_die_map(c->topo.die_id, cpu);
> #else
> c->topo.logical_pkg_id = 0;
> #endif
> --
https://lore.kernel.org/r/20240213210252.901865302@linutronix.de
If you wanna do arch/x86/ patches, do them always ontop of tip/master or
the current linux-next master branch.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-08 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 8:01 [PATCH] x86/apic: Delete useless BUG_ON in validate_apic_and_package_id() Peng Liu
2024-03-08 8:51 ` Borislav Petkov
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®