From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Mon, 28 Dec 2020 16:56:27 +0000 (+0100)
Subject: lib: aes: build failure with DEBUG=1
X-Git-Tag: v2025.01-rc5-pxa1908~2062^2~9
X-Git-Url: http://git.dujemihanovic.xyz/%22bddb.css/static/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=3e50deece014bc6e3dc57e85dc2b903630f7f69a;p=u-boot.git

lib: aes: build failure with DEBUG=1

Building fails with DEBUG=1:

lib/aes.c: In function ‘debug_print_vector’:
lib/aes.c:622:45: error:
cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
  622 |  printf("%s [%d] @0x%08x", name, num_bytes, (u32)data);

Pointers can only be cast to (uintptr_t). But anyway we have
%p for printing pointers.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/lib/aes.c b/lib/aes.c
index c998aecb3c..05ec235702 100644
--- a/lib/aes.c
+++ b/lib/aes.c
@@ -619,7 +619,7 @@ void aes_decrypt(u32 key_len, u8 *in, u8 *expkey, u8 *out)
 static void debug_print_vector(char *name, u32 num_bytes, u8 *data)
 {
 #ifdef DEBUG
-	printf("%s [%d] @0x%08x", name, num_bytes, (u32)data);
+	printf("%s [%d] @0x%p", name, num_bytes, data);
 	print_buffer(0, data, 1, num_bytes, 16);
 #endif
 }