kconfig: remove string expansion in file_lookup()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 May 2018 09:21:41 +0000 (18:21 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 May 2018 18:28:58 +0000 (03:28 +0900)
commitbb222ceeb327a9bd484ba763fe86644f6d97e0cc
tree1cc9787c75bdebeee2e6a358833a4316c1d9b8c2
parent104daea149c45cc84842ce77a9bd6436d19f3dd8
kconfig: remove string expansion in file_lookup()

There are two callers of file_lookup(), but there is no more reason
to expand the given path.

[1] zconf_initscan()
    This is used to open the first Kconfig.  sym_expand_string_value()
    has never been used in a useful way here; before opening the first
    Kconfig file, obviously there is no symbol to expand.  If you use
    expand_string_value() instead, environments in KBUILD_KCONFIG would
    be expanded, but I do not see practical benefits for that.

[2] zconf_nextfile()
    This is used to open the next file from 'source' statement.
    Symbols in the path like "arch/$SRCARCH/Kconfig" needed expanding,
    but it was replaced with the direct environment expansion.  The
    environment has already been expanded before the token is passed
    to the parser.

By the way, file_lookup() was already buggy; it expanded a given path,
but it used the path before expansion for look-up:
        if (!strcmp(name, file->name)) {

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
scripts/kconfig/util.c