[U-Boot,12/25] spl: Correct malloc debugging in board_init_r()
diff mbox series

Message ID 20181106222142.94537-13-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show
Series
  • sandbox: Changes and improvements to support verified boot
Related show

Commit Message

Simon Glass Nov. 6, 2018, 10:21 p.m. UTC
SPL does not support %#x in printf() strings so we must write out the 0x
explicitly. Update the code for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/spl/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Goldschmidt Nov. 7, 2018, 6:22 a.m. UTC | #1
On Tue, Nov 6, 2018 at 11:22 PM Simon Glass <sjg@chromium.org> wrote:
>
> SPL does not support %#x in printf() strings so we must write out the 0x
> explicitly. Update the code for this.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

This has already been covered by my patch here:
https://patchwork.ozlabs.org/patch/992555/

However, my patch fixes three more places of debug printf formatters
not supported in SPL.

Anyway:
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

> ---
>
>  common/spl/spl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index 292e659c9ac..c855bb7ca4a 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -554,7 +554,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>                 debug("Unsupported OS image.. Jumping nevertheless..\n");
>         }
>  #if CONFIG_VAL(SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
> -       debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
> +       debug("SPL malloc() used 0x%lx bytes (%ld KB)\n", gd->malloc_ptr,
>               gd->malloc_ptr / 1024);
>  #endif
>  #ifdef CONFIG_BOOTSTAGE_STASH
> --
> 2.19.1.930.g4563a0d9d0-goog
>
Simon Glass Nov. 7, 2018, 5:09 p.m. UTC | #2
Hi Simon,

On 6 November 2018 at 23:22, Simon Goldschmidt
<simon.k.r.goldschmidt@gmail.com> wrote:
> On Tue, Nov 6, 2018 at 11:22 PM Simon Glass <sjg@chromium.org> wrote:
>>
>> SPL does not support %#x in printf() strings so we must write out the 0x
>> explicitly. Update the code for this.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> This has already been covered by my patch here:
> https://patchwork.ozlabs.org/patch/992555/
>
> However, my patch fixes three more places of debug printf formatters
> not supported in SPL.
>
> Anyway:
> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
>

Yes, we should grab your one. Will mark this one superseded.

Regards,
Simon

Patch
diff mbox series

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 292e659c9ac..c855bb7ca4a 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -554,7 +554,7 @@  void board_init_r(gd_t *dummy1, ulong dummy2)
 		debug("Unsupported OS image.. Jumping nevertheless..\n");
 	}
 #if CONFIG_VAL(SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
-	debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
+	debug("SPL malloc() used 0x%lx bytes (%ld KB)\n", gd->malloc_ptr,
 	      gd->malloc_ptr / 1024);
 #endif
 #ifdef CONFIG_BOOTSTAGE_STASH