aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r--scripts/kconfig/menu.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 5cfa6c405cf0..0fce20cb7f3c 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -61,10 +61,11 @@ void menu_end_entry(void)
61{ 61{
62} 62}
63 63
64void menu_add_menu(void) 64struct menu *menu_add_menu(void)
65{ 65{
66 current_menu = current_entry; 66 menu_end_entry();
67 last_entry_ptr = &current_entry->list; 67 last_entry_ptr = &current_entry->list;
68 return current_menu = current_entry;
68} 69}
69 70
70void menu_end_menu(void) 71void menu_end_menu(void)
@@ -151,6 +152,12 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
151 menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); 152 menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep);
152} 153}
153 154
155static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2)
156{
157 return sym2->type == S_INT || sym2->type == S_HEX ||
158 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
159}
160
154void sym_check_prop(struct symbol *sym) 161void sym_check_prop(struct symbol *sym)
155{ 162{
156 struct property *prop; 163 struct property *prop;
@@ -185,8 +192,8 @@ void sym_check_prop(struct symbol *sym)
185 if (sym->type != S_INT && sym->type != S_HEX) 192 if (sym->type != S_INT && sym->type != S_HEX)
186 prop_warn(prop, "range is only allowed " 193 prop_warn(prop, "range is only allowed "
187 "for int or hex symbols"); 194 "for int or hex symbols");
188 if (!sym_string_valid(sym, prop->expr->left.sym->name) || 195 if (!menu_range_valid_sym(sym, prop->expr->left.sym) ||
189 !sym_string_valid(sym, prop->expr->right.sym->name)) 196 !menu_range_valid_sym(sym, prop->expr->right.sym))
190 prop_warn(prop, "range is invalid"); 197 prop_warn(prop, "range is invalid");
191 break; 198 break;
192 default: 199 default: