aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKarsten Wiese <annabellesgarden@yahoo.de>2006-12-13 03:34:07 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:48 -0500
commitbfc10001b11e51b59ac901d17c5f05361bd2351d (patch)
treeeee8c1ed8f7ec7389656ee5bedd087b3ccee2b9a /scripts
parentb321429325e4c911c379a5bf4156c9fc9713e425 (diff)
[PATCH] kconfig: make sym_change_count static, let it be altered by 2 functions only
Those two functions are void sym_set_change_count(int count) and void sym_add_change_count(int count) All write accesses to sym_change_count are replaced by calls to above functions. Variable and changer-functions are moved to confdata.c. IMO thats ok, as sym_change_count is an attribute of the .config's change state. Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Roman Zippel <zippel@linux-m68k.org> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/confdata.c20
-rw-r--r--scripts/kconfig/lkc.h2
-rw-r--r--scripts/kconfig/lkc_proto.h1
-rw-r--r--scripts/kconfig/symbol.c3
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped2
-rw-r--r--scripts/kconfig/zconf.y2
6 files changed, 21 insertions, 9 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 140742ebd73c..4bbbb5b09c8d 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -100,7 +100,7 @@ int conf_read_simple(const char *name, int def)
100 in = zconf_fopen(name); 100 in = zconf_fopen(name);
101 if (in) 101 if (in)
102 goto load; 102 goto load;
103 sym_change_count++; 103 sym_add_change_count(1);
104 if (!sym_defconfig_list) 104 if (!sym_defconfig_list)
105 return 1; 105 return 1;
106 106
@@ -312,7 +312,7 @@ int conf_read(const char *name)
312 struct expr *e; 312 struct expr *e;
313 int i, flags; 313 int i, flags;
314 314
315 sym_change_count = 0; 315 sym_set_change_count(0);
316 316
317 if (conf_read_simple(name, S_DEF_USER)) 317 if (conf_read_simple(name, S_DEF_USER))
318 return 1; 318 return 1;
@@ -364,7 +364,7 @@ int conf_read(const char *name)
364 sym->flags &= flags | ~SYMBOL_DEF_USER; 364 sym->flags &= flags | ~SYMBOL_DEF_USER;
365 } 365 }
366 366
367 sym_change_count += conf_warnings || conf_unsaved; 367 sym_add_change_count(conf_warnings || conf_unsaved);
368 368
369 return 0; 369 return 0;
370} 370}
@@ -528,7 +528,7 @@ int conf_write(const char *name)
528 "# configuration written to %s\n" 528 "# configuration written to %s\n"
529 "#\n"), newname); 529 "#\n"), newname);
530 530
531 sym_change_count = 0; 531 sym_set_change_count(0);
532 532
533 return 0; 533 return 0;
534} 534}
@@ -766,6 +766,18 @@ int conf_write_autoconf(void)
766 return 0; 766 return 0;
767} 767}
768 768
769static int sym_change_count;
770
771void sym_set_change_count(int count)
772{
773 sym_change_count = count;
774}
775
776void sym_add_change_count(int count)
777{
778 sym_change_count += count;
779}
780
769bool conf_get_changed(void) 781bool conf_get_changed(void)
770{ 782{
771 return sym_change_count; 783 return sym_change_count;
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 2628023a1fe1..9b2706a41548 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -65,6 +65,8 @@ char *zconf_curname(void);
65 65
66/* confdata.c */ 66/* confdata.c */
67char *conf_get_default_confname(void); 67char *conf_get_default_confname(void);
68void sym_set_change_count(int count);
69void sym_add_change_count(int count);
68 70
69/* kconfig_load.c */ 71/* kconfig_load.c */
70void kconfig_load(void); 72void kconfig_load(void);
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index 9f1823c88b73..84bb139789a0 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -17,7 +17,6 @@ P(menu_get_parent_menu,struct menu *,(struct menu *menu));
17 17
18/* symbol.c */ 18/* symbol.c */
19P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); 19P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
20P(sym_change_count,int,);
21 20
22P(sym_lookup,struct symbol *,(const char *name, int isconst)); 21P(sym_lookup,struct symbol *,(const char *name, int isconst));
23P(sym_find,struct symbol *,(const char *name)); 22P(sym_find,struct symbol *,(const char *name));
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index ee225ced2ce4..8f06c474d800 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -30,7 +30,6 @@ struct symbol symbol_yes = {
30 .flags = SYMBOL_VALID, 30 .flags = SYMBOL_VALID,
31}; 31};
32 32
33int sym_change_count;
34struct symbol *sym_defconfig_list; 33struct symbol *sym_defconfig_list;
35struct symbol *modules_sym; 34struct symbol *modules_sym;
36tristate modules_val; 35tristate modules_val;
@@ -379,7 +378,7 @@ void sym_clear_all_valid(void)
379 378
380 for_all_symbols(i, sym) 379 for_all_symbols(i, sym)
381 sym->flags &= ~SYMBOL_VALID; 380 sym->flags &= ~SYMBOL_VALID;
382 sym_change_count++; 381 sym_add_change_count(1);
383 if (modules_sym) 382 if (modules_sym)
384 sym_calc_value(modules_sym); 383 sym_calc_value(modules_sym);
385} 384}
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 2fb0a4fc61d0..d777fe85627f 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -2135,7 +2135,7 @@ void conf_parse(const char *name)
2135 sym_check_deps(sym); 2135 sym_check_deps(sym);
2136 } 2136 }
2137 2137
2138 sym_change_count = 1; 2138 sym_set_change_count(1);
2139} 2139}
2140 2140
2141const char *zconf_tokenname(int token) 2141const char *zconf_tokenname(int token)
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index ab44feb3c600..04a5864c03b1 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -504,7 +504,7 @@ void conf_parse(const char *name)
504 sym_check_deps(sym); 504 sym_check_deps(sym);
505 } 505 }
506 506
507 sym_change_count = 1; 507 sym_set_change_count(1);
508} 508}
509 509
510const char *zconf_tokenname(int token) 510const char *zconf_tokenname(int token)