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
59void menu_end_entry(void);59void menu_end_entry(void);
60void menu_add_dep(struct expr *dep);60void menu_add_dep(struct expr *dep);
61struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);61struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
62void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);62struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
63void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);63void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
64void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);64void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
65void menu_finalize(struct menu *parent);65void 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
136 return prop;136 return prop;
137}137}
138 138
139void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)139struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
140{140{
141 menu_add_prop(type, prompt, NULL, dep);141 return menu_add_prop(type, prompt, NULL, dep);
142}142}
143 143
144void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)144void 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
1531 1531
1532 {1532 {
1533 menu_add_entry(NULL);1533 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);
1535 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());1535 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1536;}1536;}
1537 break;1537 break;
@@ -1586,7 +1586,7 @@ yyreduce: · 48 unmodified lines
1586 1586
1587 {1587 {
1588 menu_add_entry(NULL);1588 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);
1590 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());1590 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1591;}1591;}
1592 break;1592 break;
@@ -1640,7 +1640,7 @@ yyreduce: · 47 unmodified lines
1640 case 86:1640 case 86:
1641 1641
1642 {1642 {
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);
1644;}1644;}
1645 break;1645 break;
1646 1646
@@ -1925,7 +1925,7 @@ void conf_parse(const char *name) · 278 unmodified lines
1925 sym_init();1925 sym_init();
1926 menu_init();1926 menu_init();
1927 modules_sym = sym_lookup("MODULES", 0);1927 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);
1929 1929
1930 //zconfdebug = 1;1930 //zconfdebug = 1;
1931 zconfparse();1931 zconfparse();
scripts/kconfig/zconf.y+4−4
@@ -342,7 +342,7 @@ if_block: · 341 unmodified lines
342menu: T_MENU prompt T_EOL342menu: T_MENU prompt T_EOL
343{343{
344 menu_add_entry(NULL);344 menu_add_entry(NULL);
345 menu_add_prop(P_MENU, $2, NULL, NULL);345 menu_add_prompt(P_MENU, $2, NULL);
346 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());346 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
347};347};
348 348
@@ -392,7 +392,7 @@ source_stmt: source · 43 unmodified lines
392comment: T_COMMENT prompt T_EOL392comment: T_COMMENT prompt T_EOL
393{393{
394 menu_add_entry(NULL);394 menu_add_entry(NULL);
395 menu_add_prop(P_COMMENT, $2, NULL, NULL);395 menu_add_prompt(P_COMMENT, $2, NULL);
396 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());396 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
397};397};
398 398
@@ -443,7 +443,7 @@ prompt_stmt_opt: · 44 unmodified lines
443 /* empty */443 /* empty */
444 | prompt if_expr444 | prompt if_expr
445{445{
446 menu_add_prop(P_PROMPT, $1, NULL, $2);446 menu_add_prompt(P_PROMPT, $1, $2);
447};447};
448 448
449prompt: T_WORD449prompt: T_WORD
@@ -487,7 +487,7 @@ void conf_parse(const char *name) · 37 unmodified lines
487 sym_init();487 sym_init();
488 menu_init();488 menu_init();
489 modules_sym = sym_lookup("MODULES", 0);489 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);
491 491
492 //zconfdebug = 1;492 //zconfdebug = 1;
493 zconfparse();493 zconfparse();