From: Ulf Magnusson <ulfalizer@gmail.com>
To: linux-kbuild@vger.kernel.org
Cc: yamada.masahiro@socionext.com, mcgrof@kernel.org,
linux-kernel@vger.kernel.org, Ulf Magnusson <ulfalizer@gmail.com>
Subject: [PATCH] kconfig: Warn if help text is blank
Date: Tue, 30 Jan 2018 19:18:53 +0100 [thread overview]
Message-ID: <20180130181853.32512-1-ulfalizer@gmail.com> (raw)
Print a warning if a 'help' token is given but the help text is blank.
Personal pet peeve.
Example warnings:
net/sched/Kconfig:860: warning: 'NET_IFE_SKBMARK' defined with blank help text
net/sched/Kconfig:865: warning: 'NET_IFE_SKBPRIO' defined with blank help text
net/sched/Kconfig:870: warning: 'NET_IFE_SKBTCINDEX' defined with blank help text
drivers/video/fbdev/Kconfig:1159: warning: 'FB_I810_I2C' defined with blank help text
drivers/mmc/host/Kconfig:877: warning: 'MMC_TOSHIBA_PCI' defined with blank help text
drivers/staging/rtl8192u/Kconfig:8: warning: 'RTL8192U' defined with blank help text
drivers/staging/rtl8192e/rtl8192e/Kconfig:9: warning: 'RTL8192E' defined with blank help text
lib/Kconfig.debug:354: warning: 'ARCH_WANT_FRAME_POINTERS' defined with blank help text
A separate patchset will be sent to fix all current instances of blank
help texts for all arches. I added the same warning to Kconfiglib.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
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;
};
--
2.14.1
next reply other threads:[~2018-01-30 18:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 18:18 Ulf Magnusson [this message]
2018-01-30 18:34 ` Paul Bolle
2018-01-30 19:33 ` Ulf Magnusson
2018-01-30 20:31 ` Paul Bolle
2018-01-31 9:53 ` Ulf Magnusson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180130181853.32512-1-ulfalizer@gmail.com \
--to=ulfalizer@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®