* [PATCH] init: simplify initramfs.o build rule
@ 2026-09-30 1:57 Yuntao Wang
2026-10-01 15:44 ` Nicolas Schier
0 siblings, 1 reply; 2+ messages in thread
From: Yuntao Wang @ 2026-09-30 1:57 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier, Andrew Morton
Cc: linux-kbuild, linux-kernel, 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.
Also, reorder the condition to make the code easier to follow.
No functional change.
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
init/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/init/Makefile b/init/Makefile
index d6f75d8907e0..9102fc34c0cc 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -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
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] init: simplify initramfs.o build rule
2026-09-30 1:57 [PATCH] init: simplify initramfs.o build rule Yuntao Wang
@ 2026-10-01 15:44 ` Nicolas Schier
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Schier @ 2026-10-01 15:44 UTC (permalink / raw)
To: Yuntao Wang; +Cc: Nathan Chancellor, Andrew Morton, linux-kbuild, linux-kernel
On Wed, Sep 30, 2026 at 09:57:48AM +0800, Yuntao Wang wrote:
> 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.
>
> Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
> ---
> init/Makefile | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Thanks!
Reviewed-by: Nicolas Schier <nsc@kernel.org>
--
Nicolas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-01 15:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 1:57 [PATCH] init: simplify initramfs.o build rule Yuntao Wang
2026-10-01 15:44 ` Nicolas Schier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®