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 <[email protected]> Reviewed-by: Simon Glass <[email protected]> --- Changes in v4: - fix and reword comment Changes in v3: - make log_err use stdout too boot/image-pre-load.c | 3 --- tools/mkimage.h | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/boot/image-pre-load.c b/boot/image-pre-load.c index 2f851ebb28c..cd319ddb777 100644 --- a/boot/image-pre-load.c +++ b/boot/image-pre-load.c @@ -35,9 +35,6 @@ ulong image_load_offset; */ static struct image_sig_info *host_info; -#define log_info(fmt, args...) printf(fmt, ##args) -#define log_err(fmt, args...) printf(fmt, ##args) - void image_pre_load_sig_set_info(struct image_sig_info *info) { host_info = info; diff --git a/tools/mkimage.h b/tools/mkimage.h index 5d6bcc9301a..d8d292a8098 100644 --- a/tools/mkimage.h +++ b/tools/mkimage.h @@ -31,6 +31,12 @@ #endif /* MKIMAGE_DEBUG */ #define log_debug(fmt, args...) debug(fmt, ##args) +#define log_info(fmt, args...) printf(fmt, ##args) +/* + * Use stdout rather than stderr so error messages stay + * interleaved with normal output in the order produced. + */ +#define log_err(fmt, args...) printf(fmt, ##args) static inline void *map_sysmem(ulong paddr, unsigned long len) { -- 2.43.0

