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

Scott Wood scottwood at freescale.com
Tue Dec 8 20:36:31 CET 2015


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.

-Scott



More information about the U-Boot mailing list