[U-Boot] [PATCH v1 6/8] spl: Disable printf if not required

Alex Kiernan alex.kiernan at gmail.com
Wed Apr 18 10:29:12 UTC 2018


On Wed, Apr 18, 2018 at 10:27 AM, Jean-Jacques Hiblot <jjhiblot at ti.com> wrote:
>
>
> On 18/04/2018 11:02, Alex Kiernan wrote:
>>
>> Now we have a guard for printf, disable it in the build if it's not
>> selected.
>>
>> Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
>> ---
>>
>>   lib/panic.c       |  3 +++
>>   lib/tiny-printf.c | 13 ++++++++-----
>>   lib/vsprintf.c    |  4 +++-
>>   3 files changed, 14 insertions(+), 6 deletions(-)
>>
>> diff --git a/lib/panic.c b/lib/panic.c
>> index e2b8b74..3ca6421 100644
>> --- a/lib/panic.c
>> +++ b/lib/panic.c
>> @@ -37,9 +37,12 @@ void panic_str(const char *str)
>>     void panic(const char *fmt, ...)
>>   {
>> +#if !(IS_ENABLED(CONFIG_SPL_BUILD) || IS_ENABLED(CONFIG_TPL_BUILD)) || \
>> +       CONFIG_IS_ENABLED(PRINTF)
>
> Why not use only CONFIG_IS_ENABLED(PRINTF) ?
>

Because I don't have a CONFIG_PRINTF, only
CONFIG_SPL_PRINTF/CONFIG_TPL_PRINTF, so you'd end up with it disabled.

But very happy to add a CONFIG_PRINTF which is default y and would
allow this to be cleaned up.

-- 
Alex Kiernan


More information about the U-Boot mailing list