public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4 v2] lib/tiny-printf.c: Add tiny printf function for space limited environments
Date: Mon, 23 Nov 2015 06:50:35 +0100	[thread overview]
Message-ID: <5652A92B.30707@denx.de> (raw)
In-Reply-To: <20151121032731.GR9551@bill-the-cat>

Hi Tom,

On 21.11.2015 04:27, Tom Rini wrote:
> On Mon, Nov 16, 2015 at 03:26:33PM +0100, Stefan Roese wrote:
>
>> This patch adds a small printf() version that supports all basic formats.
>> Its intented to be used in U-Boot SPL versions on platforms with very
>> limited internal RAM sizes.
>>
>> To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
>> will result in the SPL using this tiny function and the main U-Boot
>> still using the full-blown printf() function.
>>
>> This code was copied from:
>> http://www.sparetimelabs.com/printfrevisited
>> With mostly only coding style related changes so that its checkpatch
>> clean.
>>
>> The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
>> (Marvell AXP) SPL:
>>
>> Without this patch:
>>    58963   18536    1928   79427   13643 ./spl/u-boot-spl
>>
>> With this patch:
>>    56542   18536    1956   77034   12cea ./spl/u-boot-spl
>>
>> Note:
>> To make it possible to compile tiny-printf.c instead of vsprintf.c when
>> CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
>> moved from common/console.c into vsprintf.c in this patch.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Cc: Tom Rini <trini@konsulko.com>
>> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
>
> This doesn't quite apply now, somehow and my attempt at making it apply
> was either somehow wrong, or there's other problems with the series:
> +(PMC440,lschlv2,zynq_zc702,zynq_zed,zynq_zc706,lsxhl,zynq_picozed,zynq_zybo) examples/a
> pi/vsprintf.o: In function `printf':
> +(PMC440,lschlv2,zynq_zc702,zynq_zed,zynq_zc706,lsxhl,zynq_picozed,zynq_zybo) build/../l
> ib/vsprintf.c:865: multiple definition of `printf'
> +(PMC440,lschlv2,zynq_zc702,zynq_zed,zynq_zc706,lsxhl,zynq_picozed,zynq_zybo) examples/a
> pi/libgenwrap.o:build/../examples/api/libgenwrap.c:23: first defined here
>
> And smartweb has a longer and different failure.

Ah, thanks for checking. I hope that I've now fixed all issues with
this tiny-printf implementation. v3 will follow shortly.

Thanks,
Stefan

  reply	other threads:[~2015-11-23  5:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 14:26 [U-Boot] [PATCH 1/4 v2] common/console.c: Drop sandbox special-case console code Stefan Roese
2015-11-16 14:26 ` [U-Boot] [PATCH 2/4 v2] common/console.c: Small coding style cleanup Stefan Roese
2015-11-16 21:08   ` Simon Glass
2015-11-23 22:44   ` [U-Boot] [U-Boot, 2/4, " Tom Rini
2015-11-16 14:26 ` [U-Boot] [PATCH 3/4 v2] lib/tiny-printf.c: Add tiny printf function for space limited environments Stefan Roese
2015-11-21  3:27   ` Tom Rini
2015-11-23  5:50     ` Stefan Roese [this message]
2015-11-16 14:26 ` [U-Boot] [PATCH 4/4 v2] lib/tiny-printf.c: Support numbers bigger than 0xffff and misc updates Stefan Roese
2015-11-23 22:44   ` [U-Boot] [U-Boot, 4/4, " Tom Rini
2015-11-16 21:08 ` [U-Boot] [PATCH 1/4 v2] common/console.c: Drop sandbox special-case console code Simon Glass
2015-11-23  6:00 ` [U-Boot] [PATCH 3/4 v3] lib/tiny-printf.c: Add tiny printf function for space limited environments Stefan Roese
2015-11-23 22:44   ` [U-Boot] [U-Boot, 3/4, " Tom Rini
2015-11-23 22:44 ` [U-Boot] [U-Boot, 1/4, v2] common/console.c: Drop sandbox special-case console code Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5652A92B.30707@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox