mirror of
https://github.com/torvalds/linux.git
synced 2026-10-22 23:01:49 +02:00
Kconfig has offered "def_bool" and "def_tristate" as a shorthand for a type definition plus a default since before the git era, but has never offered the equivalent for the other three types. Conor Dooley ran into this gap[1] when fixing a symbol that had been given the wrong type: Unfortunately, there is no such thing as "def_string", but in this case we can use "default" to propagate the value of ... Nothing in the grammar requires the restriction. The rule that consumes a default is already type agnostic. Add the three missing types. No changes are needed to existing diagnostics. E.g. declaring a symbol "bool" and then assigning it with "def_string" still reports warning: ignoring type redefinition of 'CONFLICT' from 'bool' to 'string' Added tests for the types. Build tested ARCH=x86_64 with GCC 16.2.0. Tests pass with "make testconfig". Link: https://lore.kernel.org/all/20230111104848.2088516-1-conor.dooley@microchip.com/ [1] Assisted-by: LLM Signed-off-by: Kees Cook <kees@kernel.org> Tested-by: Julian Braha <julianbraha@gmail.com> Reviewed-by: Julian Braha <julianbraha@gmail.com> Link: https://patch.msgid.link/20260919005929.4077729-1-kees@kernel.org Signed-off-by: Nathan Chancellor <nathan@kernel.org> |
||
|---|---|---|
| .. | ||
| icons | ||
| lxdialog | ||
| tests | ||
| .gitignore | ||
| conf.c | ||
| confdata.c | ||
| expr.c | ||
| expr.h | ||
| gconf-cfg.sh | ||
| gconf.c | ||
| gconf.ui | ||
| internal.h | ||
| kconfig-sym-check.pl | ||
| lexer.l | ||
| lkc_proto.h | ||
| lkc.h | ||
| Makefile | ||
| mconf-cfg.sh | ||
| mconf.c | ||
| menu.c | ||
| merge_config.sh | ||
| mnconf-common.c | ||
| mnconf-common.h | ||
| nconf-cfg.sh | ||
| nconf.c | ||
| nconf.gui.c | ||
| nconf.h | ||
| parser.y | ||
| preprocess.c | ||
| preprocess.h | ||
| qconf-cfg.sh | ||
| qconf.cc | ||
| qconf.h | ||
| streamline_config.pl | ||
| symbol.c | ||
| util.c | ||