Skip to content

Commit 6479f32

Browse files
ulfalizermasahir0y
authored andcommitted
kconfig: Warn if there is more than one help text
Avoids mistakes like in the following real-world example, where only the final help string ("Say Y...") was used. This particular example was fixed in commit 561b29e ("media: fix media Kconfig help syntax issues"). config DVB_NETUP_UNIDVB ... select DVB_CXD2841ER if MEDIA_SUBDRV_AUTOSELECT ---help--- Support for NetUP PCI express Universal DVB card. help Say Y when you want to support NetUP Dual Universal DVB card ... This now prints the following warning: drivers/media/pci/netup_unidvb:13: warning: 'DVB_NETUP_UNIDVB' defined with more than one help text -- only the last one will be used Also free() any extra help strings. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent b92d804 commit 6479f32

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎scripts/kconfig/zconf.y‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ help_start: T_HELP T_EOL
431431

432432
help: help_start T_HELPTEXT
433433
{
434+
if (current_entry->help) {
435+
free(current_entry->help);
436+
zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used",
437+
current_entry->sym->name ?: "<choice>");
438+
}
434439
current_entry->help = $2;
435440
};
436441

0 commit comments

Comments
 (0)