Skip to contentSkip to conversation

init: simplify initramfs.o build rule

PATCH Applied Yuntao Wang 2 participants 2 messages Sep 30 – Oct 1 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 init: simplify initramfs.o build rule

CONFIG_BLK_DEV_INITRD is known to be enabled in the else branch, so there is no need to use obj-$(CONFIG_BLK_DEV_INITRD). Use obj-y directly to make the build rule clearer.

Also, reorder the condition to make the code easier to follow.

No functional change.

---
 init/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
init/Makefile +3 -3
index d6f75d8907e0..9102fc34c0cc 100644
@@ -6,10 +6,10 @@
 ccflags-y := -fno-function-sections -fno-data-sections
 
 obj-y                          := main.o version.o mounts.o
-ifneq ($(CONFIG_BLK_DEV_INITRD),y)
-obj-y                          += noinitramfs.o
+ifeq ($(CONFIG_BLK_DEV_INITRD),y)
+obj-y                          += initramfs.o
 else
-obj-$(CONFIG_BLK_DEV_INITRD)   += initramfs.o
+obj-y                          += noinitramfs.o
 endif
 obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
 obj-$(CONFIG_INITRAMFS_TEST)   += initramfs_test.o
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Yuntao Wang

CONFIG_BLK_DEV_INITRD is known to be enabled in the else branch, so there is no need to use obj-$(CONFIG_BLK_DEV_INITRD). Use obj-y directly to make the build rule clearer.

Quoted 8 lines

Also, reorder the condition to make the code easier to follow.

No functional change.

---
 init/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Thanks!

Signature · 1 line
Nicolas