History

[PATCH] kconfig: trivial cleanup

Replace all menu_add_prop mimicking menu_add_prompt with the latter func. I've had to add a return value to menu_add_prompt for one usage. I've rebuilt scripts/kconfig/zconf.tab.c_shipped by hand to reflect changes in the source (I've not the same Bison version so regenerating it wouldn't have been not a good idea), and compared it with what Roman itself did some time ago, and it's the same. So I guess this can be finally merged.

blaisorblade@yahoo.it committed 21 years ago

Commit fb7f6ff1 parent 66d609e4 files · +11 −11Browse files

Unified · Split

4 files
  1. scripts/kconfig/lkc.h +1 −1
  2. scripts/kconfig/menu.c +2 −2
  3. scripts/kconfig/zconf.tab.c_shipped +4 −4
  4. scripts/kconfig/zconf.y +4 −4
scripts/kconfig/lkc.h+1−1
@@ -59,7 +59,7 @@ void menu_add_entry(struct symbol *sym); · 58 unmodified lines
5959 void menu_end_entry(void);
6060 void menu_add_dep(struct expr *dep);
6161 struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
62−void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
62+struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
6363 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
6464 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
6565 void menu_finalize(struct menu *parent);
scripts/kconfig/menu.c+2−2
@@ -136,9 +136,9 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e · 135 unmodified lines
136136 return prop;
137137 }
138138
139−void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
139+struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
140140 {
141− menu_add_prop(type, prompt, NULL, dep);
141+ return menu_add_prop(type, prompt, NULL, dep);
142142 }
143143
144144 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
scripts/kconfig/zconf.tab.c_shipped+4−4
@@ -1531,7 +1531,7 @@ yyreduce: · 1530 unmodified lines
15311531
15321532 {
15331533 menu_add_entry(NULL);
1534− menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
1534+ menu_add_prompt(P_MENU, yyvsp[-1].string, NULL);
15351535 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
15361536 ;}
15371537 break;
@@ -1586,7 +1586,7 @@ yyreduce: · 48 unmodified lines
15861586
15871587 {
15881588 menu_add_entry(NULL);
1589− menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
1589+ menu_add_prompt(P_COMMENT, yyvsp[-1].string, NULL);
15901590 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
15911591 ;}
15921592 break;
@@ -1640,7 +1640,7 @@ yyreduce: · 47 unmodified lines
16401640 case 86:
16411641
16421642 {
1643− menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
1643+ menu_add_prompt(P_PROMPT, yyvsp[-1].string, yyvsp[0].expr);
16441644 ;}
16451645 break;
16461646
@@ -1925,7 +1925,7 @@ void conf_parse(const char *name) · 278 unmodified lines
19251925 sym_init();
19261926 menu_init();
19271927 modules_sym = sym_lookup("MODULES", 0);
1928− rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
1928+ rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
19291929
19301930 //zconfdebug = 1;
19311931 zconfparse();
scripts/kconfig/zconf.y+4−4
@@ -342,7 +342,7 @@ if_block: · 341 unmodified lines
342342 menu: T_MENU prompt T_EOL
343343 {
344344 menu_add_entry(NULL);
345− menu_add_prop(P_MENU, $2, NULL, NULL);
345+ menu_add_prompt(P_MENU, $2, NULL);
346346 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
347347 };
348348
@@ -392,7 +392,7 @@ source_stmt: source · 43 unmodified lines
392392 comment: T_COMMENT prompt T_EOL
393393 {
394394 menu_add_entry(NULL);
395− menu_add_prop(P_COMMENT, $2, NULL, NULL);
395+ menu_add_prompt(P_COMMENT, $2, NULL);
396396 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
397397 };
398398
@@ -443,7 +443,7 @@ prompt_stmt_opt: · 44 unmodified lines
443443 /* empty */
444444 | prompt if_expr
445445 {
446− menu_add_prop(P_PROMPT, $1, NULL, $2);
446+ menu_add_prompt(P_PROMPT, $1, $2);
447447 };
448448
449449 prompt: T_WORD
@@ -487,7 +487,7 @@ void conf_parse(const char *name) · 37 unmodified lines
487487 sym_init();
488488 menu_init();
489489 modules_sym = sym_lookup("MODULES", 0);
490− rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
490+ rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
491491
492492 //zconfdebug = 1;
493493 zconfparse();