diff options
author | Tom Rini <trini@konsulko.com> | 2023-10-07 15:13:07 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-16 10:22:11 -0400 |
commit | dec5777fffcc6f9e97a20bc23fc7353b30b70ed5 (patch) | |
tree | 5f39825109fc7d8780aae3bd4df95d1878fc2b46 | |
parent | ef3ceb2cae6c4763786f5e1b9364b1c8e2d1d029 (diff) | |
download | u-boot-dec5777fffcc6f9e97a20bc23fc7353b30b70ed5.zip u-boot-dec5777fffcc6f9e97a20bc23fc7353b30b70ed5.tar.gz u-boot-dec5777fffcc6f9e97a20bc23fc7353b30b70ed5.tar.bz2 |
command.h: Add a U_BOOT_LONGHELP macro
In order to be able to discard unused long help texts without further
linker lists, add a macro for defining the long help messages which uses
__maybe_unused. This allows us to discard them as unreferenced as part
of the link.
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | include/command.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/command.h b/include/command.h index 1c4ec42..6262365 100644 --- a/include/command.h +++ b/include/command.h @@ -328,6 +328,9 @@ int cmd_source_script(ulong addr, const char *fit_uname, const char *confname); # define _CMD_HELP(x) #endif +#define U_BOOT_LONGHELP(_cmdname, text) \ + static __maybe_unused const char _cmdname##_help_text[] = text + #define U_BOOT_SUBCMDS_DO_CMD(_cmdname) \ static int do_##_cmdname(struct cmd_tbl *cmdtp, int flag, \ int argc, char *const argv[], \ |