Skip to content

Commit 3b938e2

Browse files
masahir0ypalmer-dabbelt
authored andcommitted
riscv: merge two if-blocks for KBUILD_IMAGE
In arch/riscv/Makefile, KBUILD_IMAGE is assigned in two separate if-blocks. When CONFIG_XIP_KERNEL is disabled, the decision made by the first if-block is overwritten by the second one, which is redundant and unreadable. Merge the two if-blocks. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 3dfbd2d commit 3b938e2

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

arch/riscv/Makefile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,15 @@ boot := arch/riscv/boot
133133
ifeq ($(CONFIG_XIP_KERNEL),y)
134134
KBUILD_IMAGE := $(boot)/xipImage
135135
else
136+
ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy)
137+
KBUILD_IMAGE := $(boot)/loader.bin
138+
else
139+
ifeq ($(CONFIG_EFI_ZBOOT),)
136140
KBUILD_IMAGE := $(boot)/Image.gz
141+
else
142+
KBUILD_IMAGE := $(boot)/vmlinuz.efi
143+
endif
144+
endif
137145
endif
138146

139147
libs-y += arch/riscv/lib/
@@ -153,17 +161,6 @@ endif
153161
vdso-install-y += arch/riscv/kernel/vdso/vdso.so.dbg
154162
vdso-install-$(CONFIG_COMPAT) += arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg:../compat_vdso/compat_vdso.so
155163

156-
ifneq ($(CONFIG_XIP_KERNEL),y)
157-
ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy)
158-
KBUILD_IMAGE := $(boot)/loader.bin
159-
else
160-
ifeq ($(CONFIG_EFI_ZBOOT),)
161-
KBUILD_IMAGE := $(boot)/Image.gz
162-
else
163-
KBUILD_IMAGE := $(boot)/vmlinuz.efi
164-
endif
165-
endif
166-
endif
167164
BOOT_TARGETS := Image Image.gz loader loader.bin xipImage vmlinuz.efi
168165

169166
all: $(notdir $(KBUILD_IMAGE))

0 commit comments

Comments
 (0)