Skip to content

Commit

Permalink
kconfig: Warn if help text is blank
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ulfalizer authored and masahir0y committed Feb 2, 2018
1 parent e191603 commit 1b9eda2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/kconfig/zconf.y
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 1b9eda2

Please sign in to comment.