Skip to content

Commit 5b89c6f

Browse files
masahir0ypalmer-dabbelt
authored andcommitted
riscv: fix -Wundef warning for CONFIG_RISCV_BOOT_SPINWAIT
Since commit 80b6093 ("kbuild: add -Wundef to KBUILD_CPPFLAGS for W=1 builds"), building with W=1 detects misuse of #if. $ make W=1 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- arch/riscv/kernel/ [snip] AS arch/riscv/kernel/head.o arch/riscv/kernel/head.S:329:5: warning: "CONFIG_RISCV_BOOT_SPINWAIT" is not defined, evaluates to 0 [-Wundef] 329 | #if CONFIG_RISCV_BOOT_SPINWAIT | ^~~~~~~~~~~~~~~~~~~~~~~~~~ CONFIG_RISCV_BOOT_SPINWAIT is a bool option. #ifdef should be used. Signed-off-by: Masahiro Yamada <[email protected]> Fixes: 2ffc48f ("RISC-V: Move spinwait booting method to its own config") Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 6d0cc1b commit 5b89c6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/head.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ clear_bss_done:
326326
call soc_early_init
327327
tail start_kernel
328328

329-
#if CONFIG_RISCV_BOOT_SPINWAIT
329+
#ifdef CONFIG_RISCV_BOOT_SPINWAIT
330330
.Lsecondary_start:
331331
/* Set trap vector to spin forever to help debug */
332332
la a3, .Lsecondary_park

0 commit comments

Comments
 (0)