diff mbox series

[2/5] lib: date functions in SPL

Message ID 20200415164623.142908-3-xypron.glpk@gmx.de
State New
Headers show
Series lib: reduce SPL size | expand

Commit Message

Heinrich Schuchardt April 15, 2020, 4:46 p.m. UTC
Date functions are only needed in SPL if SPL contains RTC drivers.

Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 lib/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.25.1

Comments

Tom Rini April 16, 2020, 2:32 a.m. UTC | #1
On Wed, Apr 15, 2020 at 06:46:20PM +0200, Heinrich Schuchardt wrote:

> Date functions are only needed in SPL if SPL contains RTC drivers.
> 
> Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>

Does this show up as a problem somewhere?  I don't see this resulting in
size savings anywhere, thanks.
Heinrich Schuchardt April 16, 2020, 4:30 p.m. UTC | #2
On 4/16/20 4:32 AM, Tom Rini wrote:
> On Wed, Apr 15, 2020 at 06:46:20PM +0200, Heinrich Schuchardt wrote:
>
>> Date functions are only needed in SPL if SPL contains RTC drivers.
>>
>> Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>
> Does this show up as a problem somewhere?  I don't see this resulting in
> size savings anywhere, thanks.
>

We are compiling ./spl/lib/date.o for no good reason since said patch.
It may be that the when creating u-boot-spl.bin from u-boot-spl this
gets deleted again due to linker optimization.

Best regards

Heinrich
Tom Rini April 16, 2020, 5:04 p.m. UTC | #3
On Thu, Apr 16, 2020 at 06:30:48PM +0200, Heinrich Schuchardt wrote:
> On 4/16/20 4:32 AM, Tom Rini wrote:
> > On Wed, Apr 15, 2020 at 06:46:20PM +0200, Heinrich Schuchardt wrote:
> >
> >> Date functions are only needed in SPL if SPL contains RTC drivers.
> >>
> >> Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> >
> > Does this show up as a problem somewhere?  I don't see this resulting in
> > size savings anywhere, thanks.
> >
> 
> We are compiling ./spl/lib/date.o for no good reason since said patch.
> It may be that the when creating u-boot-spl.bin from u-boot-spl this
> gets deleted again due to linker optimization.

It is discarded at link time, yes.  I'm generally dis-inclined to grab
patches like this when it adds more to the Makefile without a size
savings.
diff mbox series

Patch

diff --git a/lib/Makefile b/lib/Makefile
index 5d4bb3232c..dbea69f52c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -116,13 +116,14 @@  else
 obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o
 endif
 obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o
+obj-$(CONFIG_$(SPL_TPL_)RTC_SUPPORT) += date.o
 else
 # Main U-Boot always uses the full printf support
 obj-y += vsprintf.o strto.o
 obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
+obj-y += date.o
 endif

-obj-y += date.o
 obj-$(CONFIG_LIB_ELF) += elf.o

 #