From: Nicolas Schier <nsc@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>,
Julian Braha <julianbraha@gmail.com>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Kees Cook <kees@kernel.org>,
Jani Nikula <jani.nikula@linux.intel.com>,
Nicolas Schier <nsc@kernel.org>
Subject: [PATCH] kconfig: Warn on dead select or imply for choice values
Date: Tue, 04 Aug 2026 14:45:32 +0200 [thread overview]
Message-ID: <20260804-kconfig-warn-on-dead-select-for-choice-value-v1-1-e5c9a274d291@kernel.org> (raw)
Update the internal kconfig check to print a warning on 'select' and
'imply' statements that target on choice values.
Julian Braha reported that kconfig's 'select' and 'imply' do not work
for choice values but have no effect all. Show a warning instead of
error-out to allow kconfig to check the whole kconfig rule set.
Reported-by: Julian Braha <julianbraha@gmail.com>
Closes: https://lore.kernel.org/linux-kbuild/20260715220149.48700-1-julianbraha@gmail.com/ # [1]
Suggested-by: Kees Cook <kees@kernel.org>
Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Nicolas Schier <nsc@kernel.org>
---
Depends on related fixes in Kconfig files:
https://lore.kernel.org/r/20260729203845.387239-1-julianbraha@gmail.com # change-requested
https://lore.kernel.org/r/20260801160140.2391000-1-julianbraha@gmail.com # under-review
https://lore.kernel.org/r/20260714112047.2304856-1-julianbraha@gmail.com # under-review
https://lore.kernel.org/r/20260723104933.117413-1-julianbraha@gmail.com # applied to mips-next
https://lore.kernel.org/r/20260723122818.437802-1-julianbraha@gmail.com # applied
---
| 4 ++++
1 file changed, 4 insertions(+)
--git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b2d8d4e11e07..fc8d8cfe034d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -287,6 +287,10 @@ static void sym_check_prop(struct symbol *sym)
"'%s' has wrong type. '%s' only "
"accept arguments of bool and "
"tristate type", sym2->name, use);
+ if (sym_is_choice_value(sym2))
+ prop_warn(prop,
+ "config symbol '%s' uses %s for '%s', but '%s' is a choice value",
+ sym->name, use, sym2->name, sym2->name);
break;
case P_RANGE:
if (sym->type != S_INT && sym->type != S_HEX)
---
base-commit: 6946cd5d0aa4dd10a414ddcb7a10844fdb0ad345
change-id: 20260802-kconfig-warn-on-dead-select-for-choice-value-bd71a1de1a96
prerequisite-message-id: <20260729203845.387239-1-julianbraha@gmail.com>
prerequisite-patch-id: 3bb796da65f588d1df5003dac5af7a9d7420f266
prerequisite-message-id: <20260801160140.2391000-1-julianbraha@gmail.com>
prerequisite-patch-id: 5277c28b2d25752fb7e5827ed744b0cf0c619574
prerequisite-message-id: <20260714112047.2304856-1-julianbraha@gmail.com>
prerequisite-patch-id: bef2d24caba30e7dc2ac5189c10b6473485a1e3c
prerequisite-message-id: <20260723104933.117413-1-julianbraha@gmail.com>
prerequisite-patch-id: da49e2868fbb19afc3195cbd2868739a94aa02c3
prerequisite-message-id: <20260723122818.437802-1-julianbraha@gmail.com>
prerequisite-patch-id: 3c894964a57e4e30515fcb14226dae725555c25e
Best regards,
--
Nicolas
next reply other threads:[~2026-08-04 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 12:45 Nicolas Schier [this message]
2026-08-11 21:25 ` Julian Braha
2026-09-17 23:45 ` Nathan Chancellor
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=20260804-kconfig-warn-on-dead-select-for-choice-value-v1-1-e5c9a274d291@kernel.org \
--to=nsc@kernel.org \
--cc=jani.nikula@linux.intel.com \
--cc=julianbraha@gmail.com \
--cc=kees@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@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®