Skip to content

Commit da64a23

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Convert unreachable() to BUG()
When compiling on LoongArch, there exists the following objtool warning in arch/loongarch/kernel/machine_kexec.o: kexec_reboot() falls through to next function crash_shutdown_secondary() Avoid using unreachable() as it can (and will in the absence of UBSAN) generate fall-through code. Use BUG() so we get a "break BRK_BUG" trap (with unreachable annotation). Cc: stable@vger.kernel.org # 6.12+ Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 7eb1721 commit da64a23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/loongarch/kernel/machine_kexec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ void kexec_reboot(void)
126126
/* All secondary cpus go to kexec_smp_wait */
127127
if (smp_processor_id() > 0) {
128128
relocated_kexec_smp_wait(NULL);
129-
unreachable();
129+
BUG();
130130
}
131131
#endif
132132

133133
do_kexec = (void *)reboot_code_buffer;
134134
do_kexec(efi_boot, cmdline_ptr, systable_ptr, start_addr, first_ind_entry);
135135

136-
unreachable();
136+
BUG();
137137
}
138138

139139

0 commit comments

Comments
 (0)