diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-06-26 20:22:03 +0200 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-07-15 18:08:38 +0200 |
commit | d67624d814ae40a655981992b0f0d652e6f591b8 (patch) | |
tree | 533ec7342543ae4268dc504c08c250e366541e9c /scripts/kconfig/symbol.c | |
parent | kconfig: improve error message for dependency between choice members (diff) | |
download | linux-d67624d814ae40a655981992b0f0d652e6f591b8.tar.xz linux-d67624d814ae40a655981992b0f0d652e6f591b8.zip |
kconfig: improve error message for recursive dependency in choice
Kconfig detects recursive dependencies in a choice block, but the error
message is unclear.
[Test Code]
choice
prompt "choose"
depends on A
config A
bool "A"
config B
bool "B"
endchoice
[Result]
Kconfig:1:error: recursive dependency detected!
Kconfig:1: choice <choice> contains symbol A
Kconfig:5: symbol A is part of choice <choice>
For a resolution refer to Documentation/kbuild/kconfig-language.rst
subsection "Kconfig recursive dependency limitations"
The phrase "contains symbol A" does not accurately describe the problem.
The issue is that the choice depends on A, which is a member of itself.
The first if-block does not print a sensible message. Remove it.
This commit improves the error message to:
Kconfig:1:error: recursive dependency detected!
Kconfig:1: symbol <choice> symbol is visible depending on A
Kconfig:5: symbol A is part of choice <choice>
For a resolution refer to Documentation/kbuild/kconfig-language.rst
subsection "Kconfig recursive dependency limitations"
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/symbol.c')
-rw-r--r-- | scripts/kconfig/symbol.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 0c4b2894ac4e..787f0667836b 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -1106,12 +1106,7 @@ static void sym_check_print_recursive(struct symbol *last_sym) fprintf(stderr, "%s:%d:error: recursive dependency detected!\n", prop->filename, prop->lineno); - if (sym_is_choice(sym)) { - fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n", - menu->filename, menu->lineno, - sym->name ? sym->name : "<choice>", - next_sym->name ? next_sym->name : "<choice>"); - } else if (sym_is_choice(next_sym)) { + if (sym_is_choice(next_sym)) { fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n", menu->filename, menu->lineno, sym->name ? sym->name : "<choice>", |