Skip to content

Commit

Permalink
kconfig: do not call check_conf() for olddefconfig
Browse files Browse the repository at this point in the history
check_conf() traverses the menu tree, but it is completely no-op for
olddefconfig because the following if-else block does nothing.

    if (input_mode == listnewconfig) {
            ...
    } else if (input_mode != olddefconfig) {
            ...
    }

As the help message says, olddefconfig automatically sets new symbols
to their default value.  There is no room for manual intervention.
So, calling check_conf() for olddefconfig is odd in the first place.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
  • Loading branch information
masahir0y committed Mar 25, 2018
1 parent f467c56 commit 59a80b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static void check_conf(struct menu *menu)
if (sym->name && !sym_is_choice_value(sym)) {
printf("%s%s\n", CONFIG_, sym->name);
}
} else if (input_mode != olddefconfig) {
} else {
if (!conf_cnt++)
printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu);
Expand Down Expand Up @@ -666,15 +666,15 @@ int main(int ac, char **av)
/* fall through */
case oldconfig:
case listnewconfig:
case olddefconfig:
case silentoldconfig:
/* Update until a loop caused no more changes */
do {
conf_cnt = 0;
check_conf(&rootmenu);
} while (conf_cnt &&
(input_mode != listnewconfig &&
input_mode != olddefconfig));
} while (conf_cnt && input_mode != listnewconfig);
break;
case olddefconfig:
default:
break;
}

Expand Down

0 comments on commit 59a80b5

Please sign in to comment.