[U-Boot] [PATCH 62/71] serial: spl: Implement empty functions for SPL

Scott Wood
2012-09-18T19:23:02Z

On 09/18/2012 01:33:11 PM, Marek Vasut wrote:
> Dear Scott Wood,
>
> > On 09/18/2012 01:03:17 PM, Marek Vasut wrote:
> > > I'd say the GCC must optimize it out anyway.
> >
> > I think I got some wires crossed and was thinking about printf/puts.
> > We want those to be optimized away at compile time (not pointed to a
> > stub at link time) on an SPL that has no output support, but once
> > that's done the low level serial functions shouldn't be referenced
> > anymore, right?
>
> But if you point them to stubs, that's OK. The compiler will GC these
> useless
> stubs anyway. But wait, we're getting to LTO here, right?
>
> So the safest bet really is macro in serial.h ?

For printf/puts, we want something header-based. For the serial
functions it depends on whether we have call sites that do not get GCed.

-Scott