From: Yuntao Wang <yuntao.wang@linux.dev>
To: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Yuntao Wang <yuntao.wang@linux.dev>
Subject: [PATCH] init: simplify initramfs.o build rule
Date: Wed, 30 Sep 2026 09:57:48 +0800 [thread overview]
Message-ID: <20260930015748.311366-1-yuntao.wang@linux.dev> (raw)
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
reply other threads:[~2026-09-30 1:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260930015748.311366-1-yuntao.wang@linux.dev \
--to=yuntao.wang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®