From b472ec1fc1c17fe5f06ff853672b8d1c1d8a190e Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 31 Jan 2018 10:34:30 +0100 Subject: [PATCH] kconfig: Warn if help text is blank Blank help texts are probably either a typo, a Kconfig misunderstanding, or some kind of half-committing to adding a help text (in which case a TODO comment would be clearer, if the help text really can't be added right away). Best to flag them, IMO. Example warning: drivers/mmc/host/Kconfig:877: warning: 'MMC_TOSHIBA_PCI' defined with blank help text Signed-off-by: Ulf Magnusson Acked-by: Randy Dunlap Signed-off-by: Masahiro Yamada Signed-off-by: Christian Lamparter --- config/zconf.y | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/zconf.y b/config/zconf.y index 1aa9859..02c8550 100644 --- a/config/zconf.y +++ b/config/zconf.y @@ -436,6 +436,12 @@ help: help_start T_HELPTEXT zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used", current_entry->sym->name ?: ""); } + + /* Is the help text empty or all whitespace? */ + if ($2[strspn($2, " \f\n\r\t\v")] == '\0') + zconfprint("warning: '%s' defined with blank help text", + current_entry->sym->name ?: ""); + current_entry->help = $2; }; -- 2.31.1