diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2005-11-09 00:34:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:55:53 -0500 |
commit | 4cf3cbe2a9682242cd38897914b1f2a95f1db7e4 (patch) | |
tree | c1c4133a02171e79cc4952f19cbd9b4600035d78 /scripts/kconfig/menu.c | |
parent | 90389160efc2864501ced6e662f9419eb7a3e6c8 (diff) |
[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 <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r-- | scripts/kconfig/menu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 5cfa6c405cf0..c2a423a1c341 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) | |||
151 | menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); | 151 | menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); |
152 | } | 152 | } |
153 | 153 | ||
154 | static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2) | ||
155 | { | ||
156 | return sym2->type == S_INT || sym2->type == S_HEX || | ||
157 | (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); | ||
158 | } | ||
159 | |||
154 | void sym_check_prop(struct symbol *sym) | 160 | void sym_check_prop(struct symbol *sym) |
155 | { | 161 | { |
156 | struct property *prop; | 162 | struct property *prop; |
@@ -185,8 +191,8 @@ void sym_check_prop(struct symbol *sym) | |||
185 | if (sym->type != S_INT && sym->type != S_HEX) | 191 | if (sym->type != S_INT && sym->type != S_HEX) |
186 | prop_warn(prop, "range is only allowed " | 192 | prop_warn(prop, "range is only allowed " |
187 | "for int or hex symbols"); | 193 | "for int or hex symbols"); |
188 | if (!sym_string_valid(sym, prop->expr->left.sym->name) || | 194 | if (!menu_range_valid_sym(sym, prop->expr->left.sym) || |
189 | !sym_string_valid(sym, prop->expr->right.sym->name)) | 195 | !menu_range_valid_sym(sym, prop->expr->right.sym)) |
190 | prop_warn(prop, "range is invalid"); | 196 | prop_warn(prop, "range is invalid"); |
191 | break; | 197 | break; |
192 | default: | 198 | default: |