From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Wed, 18 Jan 2017 22:03:20 -0500 Subject: [U-Boot] [PATCH] spl: don't use %.*s with CONFIG_USE_TINY_PRINTF In-Reply-To: References: <1482910597-24780-1-git-send-email-oded.gabbay@gmail.com> Message-ID: <20170119030320.GD25981@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jan 17, 2017 at 10:06:26AM +0200, Oded Gabbay wrote: > On Tue, Jan 17, 2017 at 9:30 AM, Masahiro Yamada > wrote: > > 2016-12-28 16:36 GMT+09:00 Oded Gabbay : > >> In the tiny-printf implementation, there is no support for %.*s. This patch > >> checks if CONFIG_USE_TINY_PRINTF is defined and if so, prints a different > >> debug statement which doesn't use %.*s > >> > >> Signed-off-by: Oded Gabbay > >> Cc: Simon Glass > >> --- > >> common/spl/spl.c | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >> diff --git a/common/spl/spl.c b/common/spl/spl.c > >> index f7df834..7c4744d 100644 > >> --- a/common/spl/spl.c > >> +++ b/common/spl/spl.c > >> @@ -115,9 +115,14 @@ int spl_parse_image_header(struct spl_image_info *spl_image, > >> } > >> spl_image->os = image_get_os(header); > >> spl_image->name = image_get_name(header); > >> +#ifdef CONFIG_USE_TINY_PRINTF > >> + debug("spl: payload image: %s load addr: 0x%x size: %d\n", > >> + spl_image->name, spl_image->load_addr, spl_image->size); > >> +#else > >> debug("spl: payload image: %.*s load addr: 0x%x size: %d\n", > >> (int)sizeof(spl_image->name), spl_image->name, > >> spl_image->load_addr, spl_image->size); > >> +#endif > >> } else { > >> #ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE > > > > > > Same here. > > > > Please do not patch around with CONFIG_USE_TINY_PRINTF. > > > > What you need to do is to fix tiny_printf() implementation. > > > > > > -- > > Best Regards > > Masahiro Yamada > > ok, I can accept that but how would you like to fix it ? I would suggest un-winding things such that we get useful information in both cases with USE_TINY_PRINTF being the limiting factor. I am of the opinion that USE_TINY_PRINTF should be the default within SPL. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: