[U-Boot] [PATCH 4/7] lib: Split panic functions out of vsprintf.c

Simon Glass sjg at chromium.org
Tue Dec 8 20:38:39 CET 2015


Hi Scott,

On 8 December 2015 at 12:36, Scott Wood <scottwood at freescale.com> wrote:
> On Tue, 2015-12-08 at 12:34 -0700, Simon Glass wrote:
>> Hi Sjoerd,
>>
>> On 8 December 2015 at 00:27, Sjoerd Simons
>> <sjoerd.simons at collabora.co.uk> wrote:
>> >
>> > On Mon, 2015-12-07 at 17:39 -0700, Simon Glass wrote:
>> > > > diff --git a/lib/Makefile b/lib/Makefile
>> > > > index 1f1ff6f..ae84833 100644
>> > > > --- a/lib/Makefile
>> > > > +++ b/lib/Makefile
>> > > > @@ -85,13 +85,13 @@ obj-$(CONFIG_LIB_RAND) += rand.o
>> > > >  ifdef CONFIG_SPL_BUILD
>> > > >  # SPL U-Boot may use full-printf, tiny-printf or none at all
>> > > >  ifdef CONFIG_USE_TINY_PRINTF
>> > > > -obj-$(CONFIG_SPL_SERIAL_SUPPORT) += tiny-printf.o
>> > > > +obj-$(CONFIG_SPL_SERIAL_SUPPORT) += tiny-printf.o panic.o
>> > > >  else
>> > > > -obj-$(CONFIG_SPL_SERIAL_SUPPORT) += vsprintf.o
>> > > > +obj-$(CONFIG_SPL_SERIAL_SUPPORT) += vsprintf.o panic.o
>> > > >  endif
>> > > >  else
>> > > >  # Main U-Boot always uses the full printf support
>> > > > -obj-y += vsprintf.o
>> > > > +obj-y += vsprintf.o panic.o
>> > > >  endif
>> > >
>> > > Why not just add this outside all the ifdef stuff:
>> > >
>> > > obj-y += panic.o
>> >
>> > Just keeping the old behaviour, that code was not build for SPL builds
>> > without serial support before. Do you see a benefit of just always
>> > building it ?
>>
>> I cannot see a case where you don't build it:
>>
>> ifdef CONFIG_SPL_BUILD
>> # SPL U-Boot may use full-printf, tiny-printf or none at all
>> ifdef CONFIG_USE_TINY_PRINTF
>> obj-$(CONFIG_SPL_SERIAL_SUPPORT) += tiny-printf.o panic.o strto.o
>> else
>> obj-$(CONFIG_SPL_SERIAL_SUPPORT) += vsprintf.o panic.o strto.o
>> endif
>> else
>> # Main U-Boot always uses the full printf support
>> obj-y += vsprintf.o panic.o strto.o
>> endif
>>
>>
>> Every case has panic.o and strto.o. What am I missing?
>
> The dependency on CONFIG_SPL_SERIAL_SUPPORT.

OK, so how about this:

>> ifdef CONFIG_SPL_BUILD
>> # SPL U-Boot may use full-printf, tiny-printf or none at all

obj-$(CONFIG_SPL_SERIAL_SUPPORT) += panic.o strto.o

>> ifdef CONFIG_USE_TINY_PRINTF
obj-$(CONFIG_SPL_SERIAL_SUPPORT) += tiny-printf.o
>> else
obj-$(CONFIG_SPL_SERIAL_SUPPORT) += vsprintf.o
>> endif
>> else
>> # Main U-Boot always uses the full printf support
>> obj-y += vsprintf.o panic.o strto.o
>> endif

Regards,
Simon


More information about the U-Boot mailing list