[PATCH v3 2/4] mkimage: define log_err and log_info

Simon Glass sjg at chromium.org
Thu May 7 23:12:03 CEST 2026


Hi Ludwig,

On 2026-05-07T12:06:22, Ludwig Nussel <ludwig.nussel at siemens.com> wrote:
> mkimage: define log_err and log_info
>
> Define log_err and log_info centrally in mkimage.h so any file used in
> this context benefits from it.
>
> This patch is in preparation for a change in image-fit-sig.c in the
> next patch.
>
> Signed-off-by: Ludwig Nussel <ludwig.nussel at siemens.com>
>
> boot/image-pre-load.c | 3 ---
>  tools/mkimage.h       | 5 +++++
>  2 files changed, 5 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

> diff --git a/tools/mkimage.h b/tools/mkimage.h
> @@ -31,6 +31,11 @@
>  #endif /* MKIMAGE_DEBUG */
>
>  #define log_debug(fmt, args...)      debug(fmt, ##args)
> +#define log_info(fmt, args...)       printf(fmt, ##args)
> +/* can't use stderr here as that's unbuffered and would produce
> + * output different from u-boot's console
> + */
> +#define log_err(fmt, args...)        printf(fmt, ##args)

The comment is a bit off. These macros are only active under
USE_HOSTCC, where there is no console, so the real concern is that
stderr would interleave out of order with stdout. Something like:

   /*
    * Use stdout rather than stderr so error messages stay
    * interleaved with normal output in the order produced.
    */

Also kernel comment style puts the opening /* on its own line.

Regards,
Simon


More information about the U-Boot mailing list