diff options
-rw-r--r-- | scripts/kconfig/confdata.c | 5 | ||||
-rw-r--r-- | scripts/kconfig/expr.c | 18 | ||||
-rw-r--r-- | scripts/kconfig/expr.h | 5 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 11 | ||||
-rw-r--r-- | scripts/kconfig/lkc_proto.h | 3 | ||||
-rw-r--r-- | scripts/kconfig/menu.c | 4 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 42 |
7 files changed, 40 insertions, 48 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 28df18dd1147..c814f57672fc 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -16,6 +16,11 @@ | |||
16 | 16 | ||
17 | #include "lkc.h" | 17 | #include "lkc.h" |
18 | 18 | ||
19 | struct conf_printer { | ||
20 | void (*print_symbol)(FILE *, struct symbol *, const char *, void *); | ||
21 | void (*print_comment)(FILE *, const char *, void *); | ||
22 | }; | ||
23 | |||
19 | static void conf_warning(const char *fmt, ...) | 24 | static void conf_warning(const char *fmt, ...) |
20 | __attribute__ ((format (printf, 1, 2))); | 25 | __attribute__ ((format (printf, 1, 2))); |
21 | 26 | ||
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 4b4cf8e21314..fb0a2a286dca 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c | |||
@@ -11,6 +11,12 @@ | |||
11 | 11 | ||
12 | #define DEBUG_EXPR 0 | 12 | #define DEBUG_EXPR 0 |
13 | 13 | ||
14 | static int expr_eq(struct expr *e1, struct expr *e2); | ||
15 | static struct expr *expr_eliminate_yn(struct expr *e); | ||
16 | static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2); | ||
17 | static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2); | ||
18 | static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2); | ||
19 | |||
14 | struct expr *expr_alloc_symbol(struct symbol *sym) | 20 | struct expr *expr_alloc_symbol(struct symbol *sym) |
15 | { | 21 | { |
16 | struct expr *e = xcalloc(1, sizeof(*e)); | 22 | struct expr *e = xcalloc(1, sizeof(*e)); |
@@ -186,7 +192,7 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2) | |||
186 | #undef e1 | 192 | #undef e1 |
187 | #undef e2 | 193 | #undef e2 |
188 | 194 | ||
189 | int expr_eq(struct expr *e1, struct expr *e2) | 195 | static int expr_eq(struct expr *e1, struct expr *e2) |
190 | { | 196 | { |
191 | int res, old_count; | 197 | int res, old_count; |
192 | 198 | ||
@@ -228,7 +234,7 @@ int expr_eq(struct expr *e1, struct expr *e2) | |||
228 | return 0; | 234 | return 0; |
229 | } | 235 | } |
230 | 236 | ||
231 | struct expr *expr_eliminate_yn(struct expr *e) | 237 | static struct expr *expr_eliminate_yn(struct expr *e) |
232 | { | 238 | { |
233 | struct expr *tmp; | 239 | struct expr *tmp; |
234 | 240 | ||
@@ -823,7 +829,7 @@ bool expr_depends_symbol(struct expr *dep, struct symbol *sym) | |||
823 | return false; | 829 | return false; |
824 | } | 830 | } |
825 | 831 | ||
826 | struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) | 832 | static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) |
827 | { | 833 | { |
828 | struct expr *tmp = NULL; | 834 | struct expr *tmp = NULL; |
829 | expr_extract_eq(E_AND, &tmp, ep1, ep2); | 835 | expr_extract_eq(E_AND, &tmp, ep1, ep2); |
@@ -834,7 +840,7 @@ struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) | |||
834 | return tmp; | 840 | return tmp; |
835 | } | 841 | } |
836 | 842 | ||
837 | struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) | 843 | static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) |
838 | { | 844 | { |
839 | struct expr *tmp = NULL; | 845 | struct expr *tmp = NULL; |
840 | expr_extract_eq(E_OR, &tmp, ep1, ep2); | 846 | expr_extract_eq(E_OR, &tmp, ep1, ep2); |
@@ -845,7 +851,7 @@ struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) | |||
845 | return tmp; | 851 | return tmp; |
846 | } | 852 | } |
847 | 853 | ||
848 | void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) | 854 | static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) |
849 | { | 855 | { |
850 | #define e1 (*ep1) | 856 | #define e1 (*ep1) |
851 | #define e2 (*ep2) | 857 | #define e2 (*ep2) |
@@ -976,7 +982,7 @@ tristate expr_calc_value(struct expr *e) | |||
976 | } | 982 | } |
977 | } | 983 | } |
978 | 984 | ||
979 | int expr_compare_type(enum expr_type t1, enum expr_type t2) | 985 | static int expr_compare_type(enum expr_type t1, enum expr_type t2) |
980 | { | 986 | { |
981 | if (t1 == t2) | 987 | if (t1 == t2) |
982 | return 0; | 988 | return 0; |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 412ea8a2abb8..a2fc96a2bd2c 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
@@ -205,18 +205,13 @@ struct expr *expr_alloc_and(struct expr *e1, struct expr *e2); | |||
205 | struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); | 205 | struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); |
206 | struct expr *expr_copy(const struct expr *org); | 206 | struct expr *expr_copy(const struct expr *org); |
207 | void expr_free(struct expr *e); | 207 | void expr_free(struct expr *e); |
208 | int expr_eq(struct expr *e1, struct expr *e2); | ||
209 | void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); | 208 | void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); |
210 | tristate expr_calc_value(struct expr *e); | 209 | tristate expr_calc_value(struct expr *e); |
211 | struct expr *expr_eliminate_yn(struct expr *e); | ||
212 | struct expr *expr_trans_bool(struct expr *e); | 210 | struct expr *expr_trans_bool(struct expr *e); |
213 | struct expr *expr_eliminate_dups(struct expr *e); | 211 | struct expr *expr_eliminate_dups(struct expr *e); |
214 | struct expr *expr_transform(struct expr *e); | 212 | struct expr *expr_transform(struct expr *e); |
215 | int expr_contains_symbol(struct expr *dep, struct symbol *sym); | 213 | int expr_contains_symbol(struct expr *dep, struct symbol *sym); |
216 | bool expr_depends_symbol(struct expr *dep, struct symbol *sym); | 214 | bool expr_depends_symbol(struct expr *dep, struct symbol *sym); |
217 | struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2); | ||
218 | struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2); | ||
219 | void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2); | ||
220 | struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); | 215 | struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); |
221 | struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); | 216 | struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); |
222 | 217 | ||
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 9f845eab56cb..91ca126ea080 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -68,9 +68,6 @@ struct kconf_id { | |||
68 | enum symbol_type stype; | 68 | enum symbol_type stype; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | extern int zconfdebug; | ||
72 | |||
73 | int zconfparse(void); | ||
74 | void zconfdump(FILE *out); | 71 | void zconfdump(FILE *out); |
75 | void zconf_starthelp(void); | 72 | void zconf_starthelp(void); |
76 | FILE *zconf_fopen(const char *name); | 73 | FILE *zconf_fopen(const char *name); |
@@ -88,11 +85,6 @@ void sym_add_change_count(int count); | |||
88 | bool conf_set_all_new_symbols(enum conf_def_mode mode); | 85 | bool conf_set_all_new_symbols(enum conf_def_mode mode); |
89 | void set_all_choice_values(struct symbol *csym); | 86 | void set_all_choice_values(struct symbol *csym); |
90 | 87 | ||
91 | struct conf_printer { | ||
92 | void (*print_symbol)(FILE *, struct symbol *, const char *, void *); | ||
93 | void (*print_comment)(FILE *, const char *, void *); | ||
94 | }; | ||
95 | |||
96 | /* confdata.c and expr.c */ | 88 | /* confdata.c and expr.c */ |
97 | static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) | 89 | static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) |
98 | { | 90 | { |
@@ -111,7 +103,6 @@ void menu_add_entry(struct symbol *sym); | |||
111 | void menu_end_entry(void); | 103 | void menu_end_entry(void); |
112 | void menu_add_dep(struct expr *dep); | 104 | void menu_add_dep(struct expr *dep); |
113 | void menu_add_visibility(struct expr *dep); | 105 | void menu_add_visibility(struct expr *dep); |
114 | struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); | ||
115 | struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); | 106 | struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); |
116 | void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); | 107 | void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); |
117 | void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); | 108 | void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); |
@@ -145,8 +136,6 @@ extern struct expr *sym_env_list; | |||
145 | 136 | ||
146 | void sym_init(void); | 137 | void sym_init(void); |
147 | void sym_clear_all_valid(void); | 138 | void sym_clear_all_valid(void); |
148 | void sym_set_all_changed(void); | ||
149 | void sym_set_changed(struct symbol *sym); | ||
150 | struct symbol *sym_choice_default(struct symbol *sym); | 139 | struct symbol *sym_choice_default(struct symbol *sym); |
151 | const char *sym_get_string_default(struct symbol *sym); | 140 | const char *sym_get_string_default(struct symbol *sym); |
152 | struct symbol *sym_check_deps(struct symbol *sym); | 141 | struct symbol *sym_check_deps(struct symbol *sym); |
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index ceddbcf1e5ac..d5398718ec2a 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
@@ -22,7 +22,6 @@ struct menu * menu_get_root_menu(struct menu *menu); | |||
22 | struct menu * menu_get_parent_menu(struct menu *menu); | 22 | struct menu * menu_get_parent_menu(struct menu *menu); |
23 | bool menu_has_help(struct menu *menu); | 23 | bool menu_has_help(struct menu *menu); |
24 | const char * menu_get_help(struct menu *menu); | 24 | const char * menu_get_help(struct menu *menu); |
25 | void get_symbol_str(struct gstr *r, struct symbol *sym, struct list_head *head); | ||
26 | struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); | 25 | struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); |
27 | void menu_get_ext_help(struct menu *menu, struct gstr *help); | 26 | void menu_get_ext_help(struct menu *menu, struct gstr *help); |
28 | 27 | ||
@@ -45,11 +44,9 @@ bool sym_string_within_range(struct symbol *sym, const char *str); | |||
45 | bool sym_set_string_value(struct symbol *sym, const char *newval); | 44 | bool sym_set_string_value(struct symbol *sym, const char *newval); |
46 | bool sym_is_changable(struct symbol *sym); | 45 | bool sym_is_changable(struct symbol *sym); |
47 | struct property * sym_get_choice_prop(struct symbol *sym); | 46 | struct property * sym_get_choice_prop(struct symbol *sym); |
48 | struct property * sym_get_default_prop(struct symbol *sym); | ||
49 | const char * sym_get_string_value(struct symbol *sym); | 47 | const char * sym_get_string_value(struct symbol *sym); |
50 | 48 | ||
51 | const char * prop_get_type_name(enum prop_type type); | 49 | const char * prop_get_type_name(enum prop_type type); |
52 | 50 | ||
53 | /* expr.c */ | 51 | /* expr.c */ |
54 | int expr_compare_type(enum expr_type t1, enum expr_type t2); | ||
55 | void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken); | 52 | void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken); |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 72c9dba84c5d..b05cc3d4a9be 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -125,7 +125,7 @@ void menu_set_type(int type) | |||
125 | sym_type_name(sym->type), sym_type_name(type)); | 125 | sym_type_name(sym->type), sym_type_name(type)); |
126 | } | 126 | } |
127 | 127 | ||
128 | struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) | 128 | static struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) |
129 | { | 129 | { |
130 | struct property *prop = prop_alloc(type, current_entry->sym); | 130 | struct property *prop = prop_alloc(type, current_entry->sym); |
131 | 131 | ||
@@ -615,7 +615,7 @@ static struct property *get_symbol_prop(struct symbol *sym) | |||
615 | /* | 615 | /* |
616 | * head is optional and may be NULL | 616 | * head is optional and may be NULL |
617 | */ | 617 | */ |
618 | void get_symbol_str(struct gstr *r, struct symbol *sym, | 618 | static void get_symbol_str(struct gstr *r, struct symbol *sym, |
619 | struct list_head *head) | 619 | struct list_head *head) |
620 | { | 620 | { |
621 | bool hit; | 621 | bool hit; |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 7caabdb51c64..6731377f9bb2 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -112,7 +112,7 @@ struct property *sym_get_env_prop(struct symbol *sym) | |||
112 | return NULL; | 112 | return NULL; |
113 | } | 113 | } |
114 | 114 | ||
115 | struct property *sym_get_default_prop(struct symbol *sym) | 115 | static struct property *sym_get_default_prop(struct symbol *sym) |
116 | { | 116 | { |
117 | struct property *prop; | 117 | struct property *prop; |
118 | 118 | ||
@@ -186,6 +186,26 @@ static void sym_validate_range(struct symbol *sym) | |||
186 | sym->curr.val = strdup(str); | 186 | sym->curr.val = strdup(str); |
187 | } | 187 | } |
188 | 188 | ||
189 | static void sym_set_changed(struct symbol *sym) | ||
190 | { | ||
191 | struct property *prop; | ||
192 | |||
193 | sym->flags |= SYMBOL_CHANGED; | ||
194 | for (prop = sym->prop; prop; prop = prop->next) { | ||
195 | if (prop->menu) | ||
196 | prop->menu->flags |= MENU_CHANGED; | ||
197 | } | ||
198 | } | ||
199 | |||
200 | static void sym_set_all_changed(void) | ||
201 | { | ||
202 | struct symbol *sym; | ||
203 | int i; | ||
204 | |||
205 | for_all_symbols(i, sym) | ||
206 | sym_set_changed(sym); | ||
207 | } | ||
208 | |||
189 | static void sym_calc_visibility(struct symbol *sym) | 209 | static void sym_calc_visibility(struct symbol *sym) |
190 | { | 210 | { |
191 | struct property *prop; | 211 | struct property *prop; |
@@ -451,26 +471,6 @@ void sym_clear_all_valid(void) | |||
451 | sym_calc_value(modules_sym); | 471 | sym_calc_value(modules_sym); |
452 | } | 472 | } |
453 | 473 | ||
454 | void sym_set_changed(struct symbol *sym) | ||
455 | { | ||
456 | struct property *prop; | ||
457 | |||
458 | sym->flags |= SYMBOL_CHANGED; | ||
459 | for (prop = sym->prop; prop; prop = prop->next) { | ||
460 | if (prop->menu) | ||
461 | prop->menu->flags |= MENU_CHANGED; | ||
462 | } | ||
463 | } | ||
464 | |||
465 | void sym_set_all_changed(void) | ||
466 | { | ||
467 | struct symbol *sym; | ||
468 | int i; | ||
469 | |||
470 | for_all_symbols(i, sym) | ||
471 | sym_set_changed(sym); | ||
472 | } | ||
473 | |||
474 | bool sym_tristate_within_range(struct symbol *sym, tristate val) | 474 | bool sym_tristate_within_range(struct symbol *sym, tristate val) |
475 | { | 475 | { |
476 | int type = sym_get_type(sym); | 476 | int type = sym_get_type(sym); |