From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 3/4] kconfig: remove P_CHOICEVAL property
Date: Mon, 8 Jul 2024 00:38:06 +0900 [thread overview]
Message-ID: <20240707153856.2483047-3-masahiroy@kernel.org> (raw)
In-Reply-To: <20240707153856.2483047-1-masahiroy@kernel.org>
This flag is unneeded because a choice member can be detected by
other means.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/kconfig/expr.h | 1 -
scripts/kconfig/gconf.c | 2 +-
scripts/kconfig/lkc.h | 5 +----
| 5 -----
scripts/kconfig/symbol.c | 6 ++++++
5 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 54b008c0161d..6e47e0ad6e6e 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -131,7 +131,6 @@ struct symbol {
#define SYMBOL_CONST 0x0001 /* symbol is const */
#define SYMBOL_CHECK 0x0008 /* used during dependency checking */
-#define SYMBOL_CHOICEVAL 0x0020 /* used as a value in a choice block */
#define SYMBOL_VALID 0x0080 /* set when symbol.curr is calculated */
#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
#define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 6b50e25133e3..c0f46f189060 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1070,7 +1070,7 @@ static gchar **fill_row(struct menu *menu)
row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
return row;
}
- if (sym->flags & SYMBOL_CHOICEVAL)
+ if (sym_is_choice_value(sym))
row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
stype = sym_get_type(sym);
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 3fa46610f25f..401bdf36323a 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -128,10 +128,7 @@ static inline bool sym_is_choice(const struct symbol *sym)
return sym->name == NULL;
}
-static inline bool sym_is_choice_value(const struct symbol *sym)
-{
- return sym->flags & SYMBOL_CHOICEVAL ? true : false;
-}
+bool sym_is_choice_value(const struct symbol *sym);
static inline bool sym_has_value(const struct symbol *sym)
{
--git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 2a9b4c4f4428..cd34cc5aefcf 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -467,11 +467,6 @@ static void _menu_finalize(struct menu *parent, bool inside_choice)
sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
}
for (menu = parent->list; menu; menu = menu->next) {
- if (sym && sym_is_choice(sym) &&
- menu->sym && !sym_is_choice_value(menu->sym)) {
- menu->sym->flags |= SYMBOL_CHOICEVAL;
- }
-
/*
* This code serves two purposes:
*
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 3255bf310cb2..6c6f238c4f7b 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -871,6 +871,11 @@ bool sym_is_changeable(const struct symbol *sym)
return !sym_is_choice(sym) && sym->visible > sym->rev_dep.tri;
}
+bool sym_is_choice_value(const struct symbol *sym)
+{
+ return !list_empty(&sym->choice_link);
+}
+
HASHTABLE_DEFINE(sym_hashtable, SYMBOL_HASHSIZE);
struct symbol *sym_lookup(const char *name, int flags)
@@ -908,6 +913,7 @@ struct symbol *sym_lookup(const char *name, int flags)
symbol->type = S_UNKNOWN;
symbol->flags = flags;
INIT_LIST_HEAD(&symbol->menus);
+ INIT_LIST_HEAD(&symbol->choice_link);
hash_add(sym_hashtable, &symbol->node, hash);
--
2.43.0
next prev parent reply other threads:[~2024-07-07 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-07 15:38 [PATCH 1/4] kconfig: call expr_eliminate_yn() at least once in expr_eliminate_dups() Masahiro Yamada
2024-07-07 15:38 ` [PATCH 2/4] kconfig: add const qualifiers to several function arguments Masahiro Yamada
2024-07-07 15:38 ` Masahiro Yamada [this message]
2024-07-07 15:40 ` [PATCH 3/4] kconfig: remove P_CHOICEVAL property Masahiro Yamada
2024-07-07 15:38 ` [PATCH 4/4] kconfig: remove 'e1' and 'e2' macros from expressoin deduplication Masahiro Yamada
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=20240707153856.2483047-3-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.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