2.6.16.18 scripts/kconfig/mconf.c
PATCH 1/1 2.6.16.18 scripts/kconfig/mconf.c
I noticed some options using 'make menuconfig help' produced nonsense results, e.g. going into 'Processor types and features' and then selecting 'help' option on 'Timer frequency' produces:
Symbol: (null) [=y]
Prompt: Timer frequency
Defined at kernel/Kconfig.hz:5
Location:
-> Processor type and features
Selected by: m
This attempted patch fixes this explaining there is no help
for menu expander, or if there is just prints the relevant help message alone, otherwise the 'top level menu help' dialogue gets printed as normal.
I think the get_symbol_str(&help, sym); could be moved into the 'if (sym->name)' test, but there are too many options to check and change, so it seems a good idea to leave in where is and just return if !sym->name.
Nick
--- linux-current/scripts/kconfig/mconf.cORIG 2006-05-30 18:58:59.000000000
+0100
+++ linux-current/scripts/kconfig/mconf.c 2006-05-30 19:10:29.000000000 +0100
@@ -402,6 +402,9 @@
bool hit;
struct property *prop;
+ if (!sym->name)
+ return;
+
str_printf(r, "Symbol: %s [=%s]\n", sym->name,
sym_get_string_value(sym));
for_all_prompts(sym, prop)
@@ -853,15 +856,17 @@
{
if (sym->name) {
str_printf(&help, "CONFIG_%s:\n\n", sym->name);
- str_append(&help, _(sym->help));
- str_append(&help, "\n");
}
- } else {
- str_append(&help, nohelp_text);
- }
+ str_append(&help, _(sym->help));
+ str_append(&help, "\n");
get_symbol_str(&help, sym); show_helptext(menu_get_prompt(menu), str_get(&help)); str_free(&help);
+ } else {
+ str_append(&help, nohelp_text);
+ show_helptext(menu_get_prompt(menu), str_get(&help));
+ str_free(&help);
+ }
}
static void show_file(const char *filename, const char *title, int r, int c)
Signature · 2 lines
"Person who say it cannot be done should not interrupt person doing it." -Chinese Proverb
Hi,
Quoted 5 lines · Nick Warne
--- linux-current/scripts/kconfig/mconf.cORIG 2006-05-30 18:58:59.000000000
+0100
+++linux-current/scripts/kconfig/mconf.c2006-05-30 19:10:29.000000000 +0100
Review line 410
Quoted 9 lines
(quoted diff) +3
-0@@ -402,6 +402,9 @@ bool hit; struct property *prop; + if (!sym->name) + return; + str_printf(r, "Symbol: %s [=%s]\n", sym->name, sym_get_string_value(sym)); for_all_prompts(sym, prop)
Only choice symbols currently have no name, but there are otherwise normal symbols, so there is need to just return here. This should look more like:
if (sym->name) str_printf(r, "Symbol: %s", sym->name); else if (sym_is_choice(sym)) str_printf(r, "Choice:"); else str_printf(r, "Weird symbol:"); str_printf(r, "[=%s]\n", sym_get_string_value(sym));
Quoted 11 lines
(quoted diff) +1
-5@@ -853,15 +856,17 @@ { if (sym->name) { str_printf(&help, "CONFIG_%s:\n\n", sym->name); - str_append(&help, _(sym->help)); - str_append(&help, "\n"); } - } else { - str_append(&help, nohelp_text); - } + str_append(&help, _(sym->help));
Review line 870
Quoted 10 lines
(quoted diff) +6
-0+ str_append(&help, "\n"); get_symbol_str(&help, sym); show_helptext(menu_get_prompt(menu), str_get(&help)); str_free(&help); + } else { + str_append(&help, nohelp_text); + show_helptext(menu_get_prompt(menu), str_get(&help)); + str_free(&help); + } }
That looks a little misformated, anyway, this should just be:
if (sym->name) str_printf(&help, "CONFIG_%s:\n\n", sym->name); str_append(&help, sym->help ? _(sym->help) : nohelp_text); str_append(&help, "\n"); get_symbol_str(&help, sym); show_helptext(menu_get_prompt(menu), str_get(&help)); str_free(&help);
bye, Roman
Quoted 24 lines · Roman Zippel
Hi,
Only choice symbols currently have no name, but there are otherwise normal symbols, so there is need to just return here. This should look more like:
if (sym->name) str_printf(r, "Symbol: %s", sym->name); else if (sym_is_choice(sym)) str_printf(r, "Choice:"); else str_printf(r, "Weird symbol:"); str_printf(r, "[=%s]\n", sym_get_string_value(sym));That looks a little misformated, anyway, this should just be:
if (sym->name) str_printf(&help, "CONFIG_%s:\n\n", sym->name); str_append(&help, sym->help ? _(sym->help) : nohelp_text); str_append(&help, "\n"); get_symbol_str(&help, sym); show_helptext(menu_get_prompt(menu), str_get(&help)); str_free(&help);
Quoted 1 line
bye, Roman
Hi Roman,
I see, thanks - that works good, but one little thing - menu expanders now produce a funny line at the end e.g. from 'Processor type and features -> memory model' help, the last line:
Choice:[=y]
Prompt: Memory model
Defined at mm/Kconfig:5
Depends on: SELECT_MEMORY_MODEL
-> Processor type and features
Selected by: SELECT_MEMORY_MODEL && mI don't know what '&& m' means and it isn't selected by anything; I think it is bogus... so I have added a line to stop the 'selected by' being used if the 'help' option is on a 'menu expander -->'
Nick
--- linux-current/scripts/kconfig/mconf.cORIG 2006-05-30 18:58:59.000000000
+0100
+++ linux-current/scripts/kconfig/mconf.c 2006-06-02 18:19:35.000000000 +0100
@@ -402,8 +402,13 @@
bool hit;
struct property *prop;
- str_printf(r, "Symbol: %s [=%s]\n", sym->name,
- sym_get_string_value(sym));
+ if (sym->name)
+ str_printf(r, "Symbol: %s", sym->name);
+ else if (sym_is_choice(sym))
+ str_printf(r, "Choice:");
+ else
+ str_printf(r, "Weird symbol:");
+ str_printf(r, "[=%s]\n", sym_get_string_value(sym));
for_all_prompts(sym, prop)
get_prompt_str(r, prop);
hit = false;
@@ -417,7 +422,7 @@
}
if (hit)
str_append(r, "\n");
- if (sym->rev_dep.expr) {
+ if (sym->rev_dep.expr && !sym_is_choice(sym)) {
str_append(r, " Selected by: "); expr_gstr_print(sym->rev_dep.expr, r); str_append(r, "\n");
@@ -849,19 +854,15 @@
struct gstr help = str_new();
struct symbol *sym = menu->sym;
- if (sym->help)
- {
- if (sym->name) {
- str_printf(&help, "CONFIG_%s:\n\n", sym->name);
- str_append(&help, _(sym->help));
- str_append(&help, "\n");
- }
- } else {
- str_append(&help, nohelp_text);
- }
- get_symbol_str(&help, sym);
- show_helptext(menu_get_prompt(menu), str_get(&help));
- str_free(&help);
+ if (sym->name)
+ str_printf(&help, "CONFIG_%s:\n\n", sym->name);
+
+ str_append(&help, sym->help ? _(sym->help) : nohelp_text); + str_append(&help, "\n"); + get_symbol_str(&help, sym); + show_helptext(menu_get_prompt(menu), str_get(&help)); + str_free(&help);
+
}
static void show_file(const char *filename, const char *title, int r, int c)
Signature · 2 lines
"Person who say it cannot be done should not interrupt person doing it." -Chinese Proverb