From: Josh Poimboeuf Date: Tue, 14 Feb 2023 07:05:44 +0000 (-0800) Subject: mips/cpu: Make sure play_dead() doesn't return X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a80ceed6c9c24088d7a2e3c414eae1fe88a8ccbe;p=linux.git mips/cpu: Make sure play_dead() doesn't return play_dead() doesn't return. Make that more explicit with a BUG(). BUG() is preferable to unreachable() because BUG() is a more explicit failure mode and avoids undefined behavior like falling off the edge of the function into whatever code happens to be next. Acked-by: Florian Fainelli Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/b195e4da190bb06b7d4af15d66ce6129e2347630.1676358308.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf --- diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index 51d5dae1d2f05..15466d4cf4a0e 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c @@ -415,6 +415,8 @@ void __ref play_dead(void) " wait\n" " j bmips_secondary_reentry\n" : : : "memory"); + + BUG(); } #endif /* CONFIG_HOTPLUG_CPU */ diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c index 4e24b317e7cbb..df8d789ede3c3 100644 --- a/arch/mips/loongson64/smp.c +++ b/arch/mips/loongson64/smp.c @@ -823,6 +823,7 @@ out: state_addr = &per_cpu(cpu_state, cpu); mb(); play_dead_at_ckseg1(state_addr); + BUG(); } static int loongson3_disable_clock(unsigned int cpu)