aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-01-12 01:47:47 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-21 10:49:29 -0500
commit6479f327dea60ddc2be065c7d174273fb4837f03 (patch)
tree9b8639c5b9ef8676cb8d1640b19a82bc4c0a62ff /scripts
parentb92d804a51796b77c7b2b11881b2700eaac88114 (diff)
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 561b29e4ec8d ("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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/zconf.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index db5fbd8ac686..d2964c68f066 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -431,6 +431,11 @@ help_start: T_HELP T_EOL
431 431
432help: help_start T_HELPTEXT 432help: help_start T_HELPTEXT
433{ 433{
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 }
434 current_entry->help = $2; 439 current_entry->help = $2;
435}; 440};
436 441