]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
command.h: Add a U_BOOT_LONGHELP macro
authorTom Rini <trini@konsulko.com>
Sat, 7 Oct 2023 19:13:07 +0000 (15:13 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 16 Oct 2023 14:22:11 +0000 (10:22 -0400)
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>
include/command.h

index 1c4ec4257a5e1525df37b3ced6dd6fd5ef02e3de..6262365e128fe9d063002ed26050fbaf299c21b5 100644 (file)
@@ -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[],          \