diff options
author | Quentin Schulz <quentin.schulz@bootlin.com> | 2019-01-17 10:18:47 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-01-18 13:40:34 -0500 |
commit | a645831ca0962532660e4db3155a8be85e5ca312 (patch) | |
tree | 0dbb253459c414239d5b969ff0339d9776b954c8 /cmd | |
parent | facdc5fb8346967fac04e64727eeb29c62968635 (diff) | |
download | u-boot-a645831ca0962532660e4db3155a8be85e5ca312.zip u-boot-a645831ca0962532660e4db3155a8be85e5ca312.tar.gz u-boot-a645831ca0962532660e4db3155a8be85e5ca312.tar.bz2 |
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>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/mtd.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -519,8 +519,8 @@ static int mtd_name_complete(int argc, char * const argv[], char last_char, } #endif /* CONFIG_AUTO_COMPLETE */ -static char mtd_help_text[] = #ifdef CONFIG_SYS_LONGHELP +static char mtd_help_text[] = "- generic operations on memory technology devices\n\n" "mtd list\n" "mtd read[.raw][.oob] <name> <addr> [<off> [<size>]]\n" @@ -541,9 +541,8 @@ static char mtd_help_text[] = "\t\t* must be a multiple of a block for erase\n" "\t\t* must be a multiple of a page otherwise (special case: default is a page with dump)\n" "\n" - "The .dontskipff option forces writing empty pages, don't use it if unsure.\n" + "The .dontskipff option forces writing empty pages, don't use it if unsure.\n"; #endif - ""; U_BOOT_CMD_WITH_SUBCMDS(mtd, "MTD utils", mtd_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_mtd_list), |