On Fri, Jul 15, 2022 at 10:35:00AM -0500, Andrew Davis wrote:

> From: "Andrew F. Davis" <a...@ti.com>
> 
> Print statements in SPL depend on lib/common support, due to this many
> such print statements are ifdef'd. Instead of checking at each call site
> move the check to the common.h header and remove these inline checks.
> 
> Signed-off-by: Andrew F. Davis <a...@ti.com>
> Reviewed-by: Simon Glass <s...@chromium.org>

I thought we had this already, but I guess not.  That said:

[snip]
> diff --git a/include/stdio.h b/include/stdio.h
> index 1939a48f0f..2fbc3da5f9 100644
> --- a/include/stdio.h
> +++ b/include/stdio.h
> @@ -10,9 +10,8 @@ int tstc(void);
>  
>  /* stdout */
>  #if !defined(CONFIG_SPL_BUILD) || \
> -     (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL)) || \
> -     (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \
> -             defined(CONFIG_SPL_SERIAL))
> +     (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL) && 
> defined(CONFIG_TPL_LIBCOMMON_SUPPORT)) || \
> +     (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_SERIAL) && 
> defined(CONFIG_SPL_LIBCOMMON_SUPPORT) && !defined(CONFIG_TPL_BUILD))

Can we write this as something like:
#if !defined(CONFIG_SPL_BUILD) || \
        (CONFIG_IS_ENABLED(BUILD) && CONFIG_IS_ENABLED(SERIAL) &&
        CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT))

?  I'm not 100% sure it will work for CONFIG_SPL_BUILD /
CONFIG_TPL_BUILD but it should for the rest and mean we can slightly
clean it up.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to