aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-30 21:13:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-30 21:13:17 -0400
commit2b17b4382c4bcb1952e9c6953284044970a274f3 (patch)
tree76999d2060412419fb9997c4efb732a8a7cc89d5 /scripts
parentf558c272386a0f7507cc8de7b6b5afc24d17fa9c (diff)
parent9875c42d6979a7db0b8d217e2a88095b753f482c (diff)
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig bits from Michal Marek: "There is one fix for make oldconfig by Arnaud and updates to the merge_config.sh tool." * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: merge_config.sh: Add option to display redundant configs merge_config.sh: Set execute bit merge_config.sh: Use the first file as the initial config kconfig: fix new choices being skipped upon config update
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/confdata.c26
-rwxr-xr-x[-rw-r--r--]scripts/kconfig/merge_config.sh15
-rw-r--r--scripts/kconfig/symbol.c9
3 files changed, 28 insertions, 22 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 7c7a5a6cc3f5..0586085136d1 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -344,10 +344,8 @@ setsym:
344 344
345int conf_read(const char *name) 345int conf_read(const char *name)
346{ 346{
347 struct symbol *sym, *choice_sym; 347 struct symbol *sym;
348 struct property *prop; 348 int i;
349 struct expr *e;
350 int i, flags;
351 349
352 sym_set_change_count(0); 350 sym_set_change_count(0);
353 351
@@ -357,7 +355,7 @@ int conf_read(const char *name)
357 for_all_symbols(i, sym) { 355 for_all_symbols(i, sym) {
358 sym_calc_value(sym); 356 sym_calc_value(sym);
359 if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) 357 if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO))
360 goto sym_ok; 358 continue;
361 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { 359 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
362 /* check that calculated value agrees with saved value */ 360 /* check that calculated value agrees with saved value */
363 switch (sym->type) { 361 switch (sym->type) {
@@ -366,30 +364,18 @@ int conf_read(const char *name)
366 if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) 364 if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym))
367 break; 365 break;
368 if (!sym_is_choice(sym)) 366 if (!sym_is_choice(sym))
369 goto sym_ok; 367 continue;
370 /* fall through */ 368 /* fall through */
371 default: 369 default:
372 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) 370 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
373 goto sym_ok; 371 continue;
374 break; 372 break;
375 } 373 }
376 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) 374 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE))
377 /* no previous value and not saved */ 375 /* no previous value and not saved */
378 goto sym_ok; 376 continue;
379 conf_unsaved++; 377 conf_unsaved++;
380 /* maybe print value in verbose mode... */ 378 /* maybe print value in verbose mode... */
381 sym_ok:
382 if (!sym_is_choice(sym))
383 continue;
384 /* The choice symbol only has a set value (and thus is not new)
385 * if all its visible childs have values.
386 */
387 prop = sym_get_choice_prop(sym);
388 flags = sym->flags;
389 expr_list_for_each_sym(prop->expr, e, choice_sym)
390 if (choice_sym->visible != no)
391 flags &= choice_sym->flags;
392 sym->flags &= flags | ~SYMBOL_DEF_USER;
393 } 379 }
394 380
395 for_all_symbols(i, sym) { 381 for_all_symbols(i, sym) {
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index ceadf0e150cf..974d5cb7e30a 100644..100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -31,10 +31,12 @@ usage() {
31 echo " -h display this help text" 31 echo " -h display this help text"
32 echo " -m only merge the fragments, do not execute the make command" 32 echo " -m only merge the fragments, do not execute the make command"
33 echo " -n use allnoconfig instead of alldefconfig" 33 echo " -n use allnoconfig instead of alldefconfig"
34 echo " -r list redundant entries when merging fragments"
34} 35}
35 36
36MAKE=true 37MAKE=true
37ALLTARGET=alldefconfig 38ALLTARGET=alldefconfig
39WARNREDUN=false
38 40
39while true; do 41while true; do
40 case $1 in 42 case $1 in
@@ -52,18 +54,27 @@ while true; do
52 usage 54 usage
53 exit 55 exit
54 ;; 56 ;;
57 "-r")
58 WARNREDUN=true
59 shift
60 continue
61 ;;
55 *) 62 *)
56 break 63 break
57 ;; 64 ;;
58 esac 65 esac
59done 66done
60 67
61 68INITFILE=$1
69shift;
62 70
63MERGE_LIST=$* 71MERGE_LIST=$*
64SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" 72SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
65TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) 73TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
66 74
75echo "Using $INITFILE as base"
76cat $INITFILE > $TMP_FILE
77
67# Merge files, printing warnings on overrided values 78# Merge files, printing warnings on overrided values
68for MERGE_FILE in $MERGE_LIST ; do 79for MERGE_FILE in $MERGE_LIST ; do
69 echo "Merging $MERGE_FILE" 80 echo "Merging $MERGE_FILE"
@@ -79,6 +90,8 @@ for MERGE_FILE in $MERGE_LIST ; do
79 echo Previous value: $PREV_VAL 90 echo Previous value: $PREV_VAL
80 echo New value: $NEW_VAL 91 echo New value: $NEW_VAL
81 echo 92 echo
93 elif [ "$WARNREDUN" = "true" ]; then
94 echo Value of $CFG is redundant by fragment $MERGE_FILE:
82 fi 95 fi
83 sed -i "/$CFG[ =]/d" $TMP_FILE 96 sed -i "/$CFG[ =]/d" $TMP_FILE
84 fi 97 fi
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 071f00c3046e..22a3c400fc41 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -262,11 +262,18 @@ static struct symbol *sym_calc_choice(struct symbol *sym)
262 struct symbol *def_sym; 262 struct symbol *def_sym;
263 struct property *prop; 263 struct property *prop;
264 struct expr *e; 264 struct expr *e;
265 int flags;
265 266
266 /* first calculate all choice values' visibilities */ 267 /* first calculate all choice values' visibilities */
268 flags = sym->flags;
267 prop = sym_get_choice_prop(sym); 269 prop = sym_get_choice_prop(sym);
268 expr_list_for_each_sym(prop->expr, e, def_sym) 270 expr_list_for_each_sym(prop->expr, e, def_sym) {
269 sym_calc_visibility(def_sym); 271 sym_calc_visibility(def_sym);
272 if (def_sym->visible != no)
273 flags &= def_sym->flags;
274 }
275
276 sym->flags &= flags | ~SYMBOL_DEF_USER;
270 277
271 /* is the user choice visible? */ 278 /* is the user choice visible? */
272 def_sym = sym->def[S_DEF_USER].val; 279 def_sym = sym->def[S_DEF_USER].val;