]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kconfig: refactor error messages in sym_check_print_recursive()
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 26 Jun 2024 18:22:04 +0000 (03:22 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 15 Jul 2024 16:08:38 +0000 (01:08 +0900)
commitd5afb4824f142205900aa4a3a133b5dd68720e67
tree6296cdfe5d76267c092c9298969fac1566ccf2b7
parentd67624d814ae40a655981992b0f0d652e6f591b8
kconfig: refactor error messages in sym_check_print_recursive()

Improve the error messages and clean up redundant code.

[1] remove redundant next_sym->name checks

If 'next_sym' is a choice, the first 'if' block is executed. In the
subsequent 'else if' blocks, 'next_sym" is not a choice, hence
next_sym->name is not NULL.

[2] remove redundant sym->name checks

A choice is never selected or implied by anyone because it has no name
(it is syntactically impossible). If it is, sym->name is not NULL.

[3] Show the location of choice instead of "<choice>"

"part of choice <choice>" does not convey useful information. Since a
choice has no name, it is more informative to display the file name and
line number.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/symbol.c