Commit 1a90b0cd authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: associate struct property with file name directly

struct property is linked to struct file for diagnostic purposes.
It is always used to retrieve the file name through prop->file->name.

Associate struct property with the file name directly.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 40bab83a
...@@ -195,7 +195,7 @@ struct property { ...@@ -195,7 +195,7 @@ struct property {
struct menu *menu; /* the menu the property are associated with struct menu *menu; /* the menu the property are associated with
* valid for: P_SELECT, P_RANGE, P_CHOICE, * valid for: P_SELECT, P_RANGE, P_CHOICE,
* P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */ * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */
struct file *file; /* what file was this property defined */ const char *filename; /* what file was this property defined */
int lineno; /* what lineno was this property defined */ int lineno; /* what lineno was this property defined */
}; };
......
...@@ -33,7 +33,7 @@ static void prop_warn(struct property *prop, const char *fmt, ...) ...@@ -33,7 +33,7 @@ static void prop_warn(struct property *prop, const char *fmt, ...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno); fprintf(stderr, "%s:%d:warning: ", prop->filename, prop->lineno);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
va_end(ap); va_end(ap);
...@@ -134,7 +134,7 @@ static struct property *menu_add_prop(enum prop_type type, struct expr *expr, ...@@ -134,7 +134,7 @@ static struct property *menu_add_prop(enum prop_type type, struct expr *expr,
prop = xmalloc(sizeof(*prop)); prop = xmalloc(sizeof(*prop));
memset(prop, 0, sizeof(*prop)); memset(prop, 0, sizeof(*prop));
prop->type = type; prop->type = type;
prop->file = current_file; prop->filename = cur_filename;
prop->lineno = cur_lineno; prop->lineno = cur_lineno;
prop->menu = current_entry; prop->menu = current_entry;
prop->expr = expr; prop->expr = expr;
......
...@@ -1041,7 +1041,7 @@ static void sym_check_print_recursive(struct symbol *last_sym) ...@@ -1041,7 +1041,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
} }
if (stack->sym == last_sym) if (stack->sym == last_sym)
fprintf(stderr, "%s:%d:error: recursive dependency detected!\n", fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
prop->file->name, prop->lineno); prop->filename, prop->lineno);
if (sym_is_choice(sym)) { if (sym_is_choice(sym)) {
fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n", fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n",
...@@ -1055,28 +1055,28 @@ static void sym_check_print_recursive(struct symbol *last_sym) ...@@ -1055,28 +1055,28 @@ static void sym_check_print_recursive(struct symbol *last_sym)
next_sym->name ? next_sym->name : "<choice>"); next_sym->name ? next_sym->name : "<choice>");
} else if (stack->expr == &sym->dir_dep.expr) { } else if (stack->expr == &sym->dir_dep.expr) {
fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n", fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n",
prop->file->name, prop->lineno, prop->filename, prop->lineno,
sym->name ? sym->name : "<choice>", sym->name ? sym->name : "<choice>",
next_sym->name ? next_sym->name : "<choice>"); next_sym->name ? next_sym->name : "<choice>");
} else if (stack->expr == &sym->rev_dep.expr) { } else if (stack->expr == &sym->rev_dep.expr) {
fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n", fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n",
prop->file->name, prop->lineno, prop->filename, prop->lineno,
sym->name ? sym->name : "<choice>", sym->name ? sym->name : "<choice>",
next_sym->name ? next_sym->name : "<choice>"); next_sym->name ? next_sym->name : "<choice>");
} else if (stack->expr == &sym->implied.expr) { } else if (stack->expr == &sym->implied.expr) {
fprintf(stderr, "%s:%d:\tsymbol %s is implied by %s\n", fprintf(stderr, "%s:%d:\tsymbol %s is implied by %s\n",
prop->file->name, prop->lineno, prop->filename, prop->lineno,
sym->name ? sym->name : "<choice>", sym->name ? sym->name : "<choice>",
next_sym->name ? next_sym->name : "<choice>"); next_sym->name ? next_sym->name : "<choice>");
} else if (stack->expr) { } else if (stack->expr) {
fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n", fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
prop->file->name, prop->lineno, prop->filename, prop->lineno,
sym->name ? sym->name : "<choice>", sym->name ? sym->name : "<choice>",
prop_get_type_name(prop->type), prop_get_type_name(prop->type),
next_sym->name ? next_sym->name : "<choice>"); next_sym->name ? next_sym->name : "<choice>");
} else { } else {
fprintf(stderr, "%s:%d:\tsymbol %s %s is visible depending on %s\n", fprintf(stderr, "%s:%d:\tsymbol %s %s is visible depending on %s\n",
prop->file->name, prop->lineno, prop->filename, prop->lineno,
sym->name ? sym->name : "<choice>", sym->name ? sym->name : "<choice>",
prop_get_type_name(prop->type), prop_get_type_name(prop->type),
next_sym->name ? next_sym->name : "<choice>"); next_sym->name ? next_sym->name : "<choice>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment