aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorWengmeiling <wengmeiling.weng@huawei.com>2013-04-30 18:28:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 20:04:09 -0400
commitbcdedcc1afd6ac91e15cb90aedaf8432f62fed13 (patch)
tree441dfd63c2189b91766880363316af0f85e2f8eb /scripts/kconfig
parent657a52095fa3e8560d41047851f4e73a410f3ed2 (diff)
menuconfig: print more info for symbol without prompts
When we search a config symbol, if it has no prompt the position of this symbol in the Kconfig file and it's dependencies are not printed. This can be inconvenient, especially when it's set to n and we want to find out why. the following is an example: before: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Selected by: X86 [=y] after: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Defined at arch/Kconfig:213 Selected by: X86 [=y] Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com> Signed-off-by: Libo Chen <libo.chen@huawei.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/menu.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index f3bffa309333..826da662886d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -515,13 +515,6 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
515 struct jump_key *jump; 515 struct jump_key *jump;
516 516
517 str_printf(r, _("Prompt: %s\n"), _(prop->text)); 517 str_printf(r, _("Prompt: %s\n"), _(prop->text));
518 str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
519 prop->menu->lineno);
520 if (!expr_is_yes(prop->visible.expr)) {
521 str_append(r, _(" Depends on: "));
522 expr_gstr_print(prop->visible.expr, r);
523 str_append(r, "\n");
524 }
525 menu = prop->menu->parent; 518 menu = prop->menu->parent;
526 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) { 519 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
527 bool accessible = menu_is_visible(menu); 520 bool accessible = menu_is_visible(menu);
@@ -572,6 +565,18 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
572} 565}
573 566
574/* 567/*
568 * get peoperty of type P_SYMBOL
569 */
570static struct property *get_symbol_prop(struct symbol *sym)
571{
572 struct property *prop = NULL;
573
574 for_all_properties(sym, prop, P_SYMBOL)
575 break;
576 return prop;
577}
578
579/*
575 * head is optional and may be NULL 580 * head is optional and may be NULL
576 */ 581 */
577void get_symbol_str(struct gstr *r, struct symbol *sym, 582void get_symbol_str(struct gstr *r, struct symbol *sym,
@@ -595,6 +600,14 @@ void get_symbol_str(struct gstr *r, struct symbol *sym,
595 } 600 }
596 for_all_prompts(sym, prop) 601 for_all_prompts(sym, prop)
597 get_prompt_str(r, prop, head); 602 get_prompt_str(r, prop, head);
603 prop = get_symbol_prop(sym);
604 str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
605 prop->menu->lineno);
606 if (!expr_is_yes(prop->visible.expr)) {
607 str_append(r, _(" Depends on: "));
608 expr_gstr_print(prop->visible.expr, r);
609 str_append(r, "\n");
610 }
598 hit = false; 611 hit = false;
599 for_all_properties(sym, prop, P_SELECT) { 612 for_all_properties(sym, prop, P_SELECT) {
600 if (!hit) { 613 if (!hit) {