Skip to content

Commit d6ee357

Browse files
committed
kconfig: rename E_OR & friends to avoid name clash
We had macros named the same as a set of enumeration values. It is legal code but very confusing to read - so rename the macros from E_* to EXPR_* Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Roman Zippel <zippel@linux-m68k.org>
1 parent d84876f commit d6ee357

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎scripts/kconfig/confdata.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ int conf_read_simple(const char *name, int def)
300300
cs->def[def].val = sym;
301301
break;
302302
}
303-
cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
303+
cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
304304
}
305305
}
306306
fclose(in);

‎scripts/kconfig/expr.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,14 +955,14 @@ tristate expr_calc_value(struct expr *e)
955955
case E_AND:
956956
val1 = expr_calc_value(e->left.expr);
957957
val2 = expr_calc_value(e->right.expr);
958-
return E_AND(val1, val2);
958+
return EXPR_AND(val1, val2);
959959
case E_OR:
960960
val1 = expr_calc_value(e->left.expr);
961961
val2 = expr_calc_value(e->right.expr);
962-
return E_OR(val1, val2);
962+
return EXPR_OR(val1, val2);
963963
case E_NOT:
964964
val1 = expr_calc_value(e->left.expr);
965-
return E_NOT(val1);
965+
return EXPR_NOT(val1);
966966
case E_EQUAL:
967967
sym_calc_value(e->left.sym);
968968
sym_calc_value(e->right.sym);

‎scripts/kconfig/expr.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ struct expr {
4545
union expr_data left, right;
4646
};
4747

48-
#define E_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2))
49-
#define E_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2))
50-
#define E_NOT(dep) (2-(dep))
48+
#define EXPR_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2))
49+
#define EXPR_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2))
50+
#define EXPR_NOT(dep) (2-(dep))
5151

5252
struct expr_value {
5353
struct expr *expr;

‎scripts/kconfig/symbol.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static void sym_calc_visibility(struct symbol *sym)
199199
tri = no;
200200
for_all_prompts(sym, prop) {
201201
prop->visible.tri = expr_calc_value(prop->visible.expr);
202-
tri = E_OR(tri, prop->visible.tri);
202+
tri = EXPR_OR(tri, prop->visible.tri);
203203
}
204204
if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
205205
tri = yes;
@@ -303,7 +303,7 @@ void sym_calc_value(struct symbol *sym)
303303
if (sym_is_choice_value(sym) && sym->visible == yes) {
304304
prop = sym_get_choice_prop(sym);
305305
newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no;
306-
} else if (E_OR(sym->visible, sym->rev_dep.tri) != no) {
306+
} else if (EXPR_OR(sym->visible, sym->rev_dep.tri) != no) {
307307
sym->flags |= SYMBOL_WRITE;
308308
if (sym_has_value(sym))
309309
newval.tri = sym->def[S_DEF_USER].tri;
@@ -312,7 +312,7 @@ void sym_calc_value(struct symbol *sym)
312312
if (prop)
313313
newval.tri = expr_calc_value(prop->expr);
314314
}
315-
newval.tri = E_OR(E_AND(newval.tri, sym->visible), sym->rev_dep.tri);
315+
newval.tri = EXPR_OR(EXPR_AND(newval.tri, sym->visible), sym->rev_dep.tri);
316316
} else if (!sym_is_choice(sym)) {
317317
prop = sym_get_default_prop(sym);
318318
if (prop) {

0 commit comments

Comments
 (0)