]> git.dujemihanovic.xyz Git - u-boot.git/commit
cmd: mtd: fix compilation warning for help when SYS_LONGHELP=n
authorQuentin Schulz <quentin.schulz@bootlin.com>
Thu, 17 Jan 2019 09:18:47 +0000 (10:18 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 18 Jan 2019 18:40:34 +0000 (13:40 -0500)
commita645831ca0962532660e4db3155a8be85e5ca312
tree0dbb253459c414239d5b969ff0339d9776b954c8
parentfacdc5fb8346967fac04e64727eeb29c62968635
cmd: mtd: fix compilation warning for help when SYS_LONGHELP=n

cmd/mtd.c:447:13: warning: ‘mtd_help_text’ defined but not used [-Wunused-variable]
static char mtd_help_text[] =
            ^~~~~~~~~~~~~

When SYS_LONGHELP is not defined. After looking at how other commands
work, we should surround the whole help text (even its declaration) with
an #ifdef CONFIG_SYS_LONGHELP, since it's compiled out when calling
_CMD_HELP[1] on the help text variable argument to U_BOOT_CMD.

[1] https://elixir.bootlin.com/u-boot/latest/source/include/command.h#L181

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
cmd/mtd.c