[PATCH 05/25] treewide: Correct use of long help
Tom Rini
trini at konsulko.com
Mon Sep 25 01:26:58 CEST 2023
On Sun, Sep 24, 2023 at 02:39:23PM -0600, Simon Glass wrote:
> Some commands assume that CONFIG_SYS_LONGHELP is always defined.
> Declaration of long help should be bracketed by an #ifdef to avoid an
> 'unused variable' warning.
>
> Fix this treewide.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
[snip]
> diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c
> index 6fa5b41fcd38..25ea7d3b37da 100644
> --- a/arch/arm/mach-imx/cmd_dek.c
> +++ b/arch/arm/mach-imx/cmd_dek.c
> @@ -393,11 +393,12 @@ static int do_dek_blob(struct cmd_tbl *cmdtp, int flag, int argc,
> return blob_encap_dek(src_addr, dst_addr, len);
> }
>
> -/***************************************************/
> +#if IS_ENABLED(CONFIG_SYS_LONGHELP)
> static char dek_blob_help_text[] =
> "src dst len - Encapsulate and create blob of data\n"
> " $len bits long at address $src and\n"
> " store the result at address $dst.\n";
> +#endif
>
> U_BOOT_CMD(
> dek_blob, 4, 1, do_dek_blob,
This really doesn't read nicely. I would rather (globally and fix
existing users) __maybe_unused this instead. I think there's just one
example today that isn't "foo_help_text".
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230924/b506cebb/attachment.sig>
More information about the U-Boot
mailing list