From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 8 Dec 2015 12:38:39 -0700 Subject: [U-Boot] [PATCH 4/7] lib: Split panic functions out of vsprintf.c In-Reply-To: <1449603391.15946.150.camel@freescale.com> References: <1449268061-805-1-git-send-email-sjoerd.simons@collabora.co.uk> <1449268061-805-5-git-send-email-sjoerd.simons@collabora.co.uk> <1449559652.2948.3.camel@collabora.co.uk> <1449603391.15946.150.camel@freescale.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Scott, On 8 December 2015 at 12:36, Scott Wood wrote: > On Tue, 2015-12-08 at 12:34 -0700, Simon Glass wrote: >> Hi Sjoerd, >> >> On 8 December 2015 at 00:27, Sjoerd Simons >> 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