History

kconfig: Rename menu_check_dep() to rewrite_m()

More directly describes the only thing it does.

Ulf Magnusson committed 9 years ago

Commit 9a826841 parent c8734431 file · +10 −6Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/menu.c+10−6
@@ -79,19 +79,23 @@ void menu_end_menu(void) · 78 unmodified lines
7979 current_menu = current_menu->parent;
8080 }
8181
82−static struct expr *menu_check_dep(struct expr *e)
82+/*
83+ * Rewrites 'm' to 'm' && MODULES, so that it evaluates to 'n' when running
84+ * without modules
85+ */
86+static struct expr *rewrite_m(struct expr *e)
8387 {
8488 if (!e)
8589 return e;
8690
8791 switch (e->type) {
8892 case E_NOT:
89− e->left.expr = menu_check_dep(e->left.expr);
93+ e->left.expr = rewrite_m(e->left.expr);
9094 break;
9195 case E_OR:
9296 case E_AND:
93− e->left.expr = menu_check_dep(e->left.expr);
94− e->right.expr = menu_check_dep(e->right.expr);
97+ e->left.expr = rewrite_m(e->left.expr);
98+ e->right.expr = rewrite_m(e->right.expr);
9599 break;
96100 case E_SYMBOL:
97101 /* change 'm' into 'm' && MODULES */
@@ -106,7 +110,7 @@ static struct expr *menu_check_dep(struct expr *e) · 8 unmodified lines
106110
107111 void menu_add_dep(struct expr *dep)
108112 {
109− current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
113+ current_entry->dep = expr_alloc_and(current_entry->dep, rewrite_m(dep));
110114 }
111115
112116 void menu_set_type(int type)
@@ -131,7 +135,7 @@ static struct property *menu_add_prop(enum prop_type type, char *prompt, struct · 18 unmodified lines
131135
132136 prop->menu = current_entry;
133137 prop->expr = expr;
134− prop->visible.expr = menu_check_dep(dep);
138+ prop->visible.expr = rewrite_m(dep);
135139
136140 if (prompt) {
137141 if (isspace(*prompt)) {