From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 27 Nov 2016 10:02:10 -0700 Subject: [U-Boot] [PATCH 05/24] SPL: tiny-printf: add "l" modifier In-Reply-To: <20161124051908.35417f08@i7> References: <1479653838-3574-1-git-send-email-andre.przywara@arm.com> <1479653838-3574-6-git-send-email-andre.przywara@arm.com> <20161124051908.35417f08@i7> 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, On 23 November 2016 at 20:19, Siarhei Siamashka wrote: > On Sun, 20 Nov 2016 14:56:59 +0000 > Andre Przywara wrote: > >> tiny-printf does not know about the "l" modifier so far, which breaks >> the crash dump on AArch64, because it uses %lx to print the registers. >> Add an easy way of handling longs correctly. > > I can't help but notice that the changes of this kind are in a way > defeating the original purpose of tiny-printf. And it is surely not > the first patch adding features to tiny-printf. I guess, in the end > we may end up with a large and bloated printf implementation again :-) > > A possible solution might be just a strict check when parsing format > modifiers and abort with an error message (yeah, this will introduce > some size increase, but hopefully the last one). This way we > acknowledge the fact that tiny-printf is a reduced incomplete > implementation, and that the callers need to take this into account. > > As for the "l" modifier. How much does it add to the code size? IMHO > this information should be mentioned in the commit message. Can the > AArch64 crash dump code be modified to avoid using it? Or can we have > the "l" modifier supported on 64-bit platforms only? > >> Signed-off-by: Andre Przywara >> --- >> lib/tiny-printf.c | 43 +++++++++++++++++++++++++++++++++---------- >> 1 file changed, 33 insertions(+), 10 deletions(-) I think I tested this patch as adding 36 bytes on Thumb2 so not too terrible. But I do agree with the sentiment. Why is aarch64 using tiny-printf? Surely all though chips have heaps of space?! Regards, Simon