From: Ulf Magnusson <ulfalizer@gmail.com>
To: yann.morin.1998@free.fr, linux-kbuild@vger.kernel.org
Cc: sam@ravnborg.org, zippel@linux-m68k.org,
nicolas.pitre@linaro.org, mmarek@suse.com, dirk@gouders.net,
yamada.masahiro@socionext.com, lacombar@gmail.com,
JBeulich@suse.com, linux-kernel@vger.kernel.org,
Ulf Magnusson <ulfalizer@gmail.com>
Subject: [PATCH 1/3] kconfig: Rename menu_check_dep() to rewrite_m()
Date: Thu, 5 Oct 2017 14:01:13 +0200 [thread overview]
Message-ID: <1507204875-5021-2-git-send-email-ulfalizer@gmail.com> (raw)
In-Reply-To: <1507204875-5021-1-git-send-email-ulfalizer@gmail.com>
More directly describes the only thing it does.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
| 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index e935793..8354dfa 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -79,19 +79,23 @@ void menu_end_menu(void)
current_menu = current_menu->parent;
}
-static struct expr *menu_check_dep(struct expr *e)
+/*
+ * Rewrites 'm' to 'm' && MODULES, so that it evaluates to 'n' when running
+ * without modules
+ */
+static struct expr *rewrite_m(struct expr *e)
{
if (!e)
return e;
switch (e->type) {
case E_NOT:
- e->left.expr = menu_check_dep(e->left.expr);
+ e->left.expr = rewrite_m(e->left.expr);
break;
case E_OR:
case E_AND:
- e->left.expr = menu_check_dep(e->left.expr);
- e->right.expr = menu_check_dep(e->right.expr);
+ e->left.expr = rewrite_m(e->left.expr);
+ e->right.expr = rewrite_m(e->right.expr);
break;
case E_SYMBOL:
/* change 'm' into 'm' && MODULES */
@@ -106,7 +110,7 @@ static struct expr *menu_check_dep(struct expr *e)
void menu_add_dep(struct expr *dep)
{
- current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
+ current_entry->dep = expr_alloc_and(current_entry->dep, rewrite_m(dep));
}
void menu_set_type(int type)
@@ -131,7 +135,7 @@ static struct property *menu_add_prop(enum prop_type type, char *prompt, struct
prop->menu = current_entry;
prop->expr = expr;
- prop->visible.expr = menu_check_dep(dep);
+ prop->visible.expr = rewrite_m(dep);
if (prompt) {
if (isspace(*prompt)) {
--
2.7.4
next prev parent reply other threads:[~2017-10-05 12:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 12:01 [PATCH 0/3] kconfig: Make 'm' safe before modules symbol is defined Ulf Magnusson
2017-10-05 12:01 ` Ulf Magnusson [this message]
2017-10-05 12:01 ` [PATCH 2/3] kconfig: Clarify expression rewriting Ulf Magnusson
2017-10-05 12:01 ` [PATCH 3/3] kconfig: Clean up modules handling and fix crash Ulf Magnusson
2017-12-14 23:27 ` [PATCH 0/3] kconfig: Make 'm' safe before modules symbol is defined 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=1507204875-5021-2-git-send-email-ulfalizer@gmail.com \
--to=ulfalizer@gmail.com \
--cc=JBeulich@suse.com \
--cc=dirk@gouders.net \
--cc=lacombar@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=nicolas.pitre@linaro.org \
--cc=sam@ravnborg.org \
--cc=yamada.masahiro@socionext.com \
--cc=yann.morin.1998@free.fr \
--cc=zippel@linux-m68k.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;
as well as URLs for NNTP newsgroup(s).