From 4cf3cbe2a9682242cd38897914b1f2a95f1db7e4 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Tue, 8 Nov 2005 21:34:49 -0800 Subject: [PATCH] kconfig: allow variable argumnts for range This allows variable arguments in the range option for int and hex config symbols. Signed-off-by: Roman Zippel Cc: Sam Ravnborg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/kconfig/menu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts/kconfig/menu.c') diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 5cfa6c405cf..c2a423a1c34 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -151,6 +151,12 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); } +static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2) +{ + return sym2->type == S_INT || sym2->type == S_HEX || + (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); +} + void sym_check_prop(struct symbol *sym) { struct property *prop; @@ -185,8 +191,8 @@ void sym_check_prop(struct symbol *sym) if (sym->type != S_INT && sym->type != S_HEX) prop_warn(prop, "range is only allowed " "for int or hex symbols"); - if (!sym_string_valid(sym, prop->expr->left.sym->name) || - !sym_string_valid(sym, prop->expr->right.sym->name)) + if (!menu_range_valid_sym(sym, prop->expr->left.sym) || + !menu_range_valid_sym(sym, prop->expr->right.sym)) prop_warn(prop, "range is invalid"); break; default: -- cgit v1.2.3