diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-05-07 01:57:07 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-06-02 09:10:32 -0400 |
commit | 3fb9acb3297f5e1170f3e45a18cc3f8b1fd1901a (patch) | |
tree | 0adcadfbee2848722c95504c49df7e5f96c562a4 | |
parent | 70ed074718a6704ac2f82d014f372ba25c42ba12 (diff) |
kconfig: fix to tag NEW symbols correctly
Those configs are not new:
$ cat .config
...
CONFIG_NAMESPACES=y
...
CONFIG_BLOCK=y
...
But are tagged as NEW:
$ yes "" | make config > myconf
$ cat myconf | grep '(NEW)'
Namespaces support (NAMESPACES) [Y/?] (NEW) y
...
Enable the block layer (BLOCK) [Y/?] (NEW) y
...
You can also notice this bug when using gconfig/xconfig.
It's because the SYMBOL_DEF_USER bit of an invisible symbol is cleared
when the config file is read:
int conf_read(const char *name)
{
...
for_all_symbols(i, sym) {
if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
/* Reset values of generates values, so they'll appear
* as new, if they should become visible, but that
* doesn't quite work if the Kconfig and the saved
* configuration disagree.
*/
if (sym->visible == no && !conf_unsaved)
sym->flags &= ~SYMBOL_DEF_USER;
...
}
But a menu item which represents an invisible symbol is still
visible, if it's sub-menu is visible, so its SYMBOL_DEF_USER
bit should be set to indicate it's not NEW.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r-- | scripts/kconfig/menu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 9d1f2adf2289..eef17bacb6bc 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -419,9 +419,13 @@ bool menu_is_visible(struct menu *menu) | |||
419 | if (!sym || sym_get_tristate_value(menu->sym) == no) | 419 | if (!sym || sym_get_tristate_value(menu->sym) == no) |
420 | return false; | 420 | return false; |
421 | 421 | ||
422 | for (child = menu->list; child; child = child->next) | 422 | for (child = menu->list; child; child = child->next) { |
423 | if (menu_is_visible(child)) | 423 | if (menu_is_visible(child)) { |
424 | if (sym) | ||
425 | sym->flags |= SYMBOL_DEF_USER; | ||
424 | return true; | 426 | return true; |
427 | } | ||
428 | } | ||
425 | 429 | ||
426 | return false; | 430 | return false; |
427 | } | 431 | } |