]> git.ipfire.org Git - people/ms/u-boot.git/commit
tiny-printf: Add support for %p format
authorVignesh R <vigneshr@ti.com>
Mon, 10 Apr 2017 06:53:22 +0000 (12:23 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 13 Apr 2017 13:41:09 +0000 (09:41 -0400)
commitcdce1f762029619e80061833b153cdbf3d0a0860
tree0c87305ad6c815383760cd8f54088aa938fd5d8d
parentb997a73ee63170579c3708a765d234f17f8effac
tiny-printf: Add support for %p format

Add support for %p, %pa[p], %pM, %pm and %pI4 formats to tiny-printf.
%pM and %pI4 are widely used by SPL networking stack and is required if
networking support is desired in SPL.
%p, %pa and %pap are mostly used by debug prints and hence supported
only when DEBUG is enabled.

Before this patch:
$ size spl/u-boot-spl
   text    data     bss     dec     hex filename
  99325    4899  218584  322808   4ecf8 spl/u-boot-spl

After this patch (with CONFIG_SPL_NET_SUPPORT):
$ size spl/u-boot-spl
   text    data     bss     dec     hex filename
  99666    4899  218584  323149   4ee4d spl/u-boot-spl

So, this patch adds ~350 bytes to code size.

If CONFIG_SPL_NET_SUPPORT is not enabled, this adds ~25 bytes.

If CONFIG_USE_TINY_PRINTF is disabled then:
$ size spl/u-boot-spl
  text    data     bss     dec     hex filename
 101116    4899  218584  324599   4f3f7 spl/u-boot-spl

So, there is still ~1.4K space saved even with support for %pM/%pI4.

Compiler used is to build is:
arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/tiny-printf.c