kconfig: Warn if help text is blank

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/1b9eda2e4892cb373c7d4cf23439f357c8739e27
Commit:     1b9eda2e4892cb373c7d4cf23439f357c8739e27
Parent:     e1916031369a60c935c6957a47618d304a9df9de
Refname:    refs/heads/master
Author:     Ulf Magnusson <[email protected]>
AuthorDate: Wed Jan 31 10:34:30 2018 +0100
Committer:  Masahiro Yamada <[email protected]>
CommitDate: Sat Feb 3 00:02:19 2018 +0900

    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 <[email protected]>
    Acked-by: Randy Dunlap <[email protected]>
    Signed-off-by: Masahiro Yamada <[email protected]>
---
 scripts/kconfig/zconf.y | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 21ce883e5d9e..4be98050b961 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/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 ?: "<choice>");
 	}
+
+	/* 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 ?: "<choice>");
+
 	current_entry->help = $2;
 };
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.