Skip to content

Commit

Permalink
command.h: Add a U_BOOT_LONGHELP macro
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
trini committed Oct 16, 2023
1 parent ef3ceb2 commit dec5777
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[], \
Expand Down

0 comments on commit dec5777

Please sign in to comment.