u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] post: memory: Fix format strings
@ 2022-08-23 19:10 Sean Anderson
  2022-08-25  1:25 ` Simon Glass
  2022-09-15 14:02 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Sean Anderson @ 2022-08-23 19:10 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: hs, Sean Anderson

This fixes numerous cases of format strings not matching their
arguments. Also keep the format strings on one line for easier grepping.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

 post/drivers/memory.c | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index 281989da6fa..4fb9355d603 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -228,9 +228,8 @@ static int memory_post_dataline(unsigned long long * pmem)
 			hi = (temp64>>32) & 0xffffffff;
 			lo = temp64 & 0xffffffff;
 
-			post_log("Memory (data line) error at %08x, "
-				  "wrote %08x%08x, read %08x%08x !\n",
-					  pmem, pathi, patlo, hi, lo);
+			post_log("Memory (data line) error at %p, wrote %08x%08x, read %08x%08x !\n",
+				 pmem, pathi, patlo, hi, lo);
 			ret = -1;
 		}
 	}
@@ -259,9 +258,8 @@ static int memory_post_addrline(ulong *testaddr, ulong *base, ulong size)
 			}
 #endif
 			if(readback == *testaddr) {
-				post_log("Memory (address line) error at %08x<->%08x, "
-					"XOR value %08x !\n",
-					testaddr, target, xor);
+				post_log("Memory (address line) error at %p<->%p, XOR value %08lx !\n",
+					 testaddr, target, xor);
 				ret = -1;
 			}
 		}
@@ -287,9 +285,8 @@ static int memory_post_test1(unsigned long start,
 	for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
 		readback = mem[i];
 		if (readback != val) {
-			post_log("Memory error at %08x, "
-				  "wrote %08x, read %08x !\n",
-					  mem + i, val, readback);
+			post_log("Memory error at %p, wrote %08lx, read %08lx !\n",
+				 mem + i, val, readback);
 
 			ret = -1;
 			break;
@@ -317,9 +314,8 @@ static int memory_post_test2(unsigned long start, unsigned long size)
 	for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
 		readback = mem[i];
 		if (readback != (1 << (i % 32))) {
-			post_log("Memory error at %08x, "
-				  "wrote %08x, read %08x !\n",
-					  mem + i, 1 << (i % 32), readback);
+			post_log("Memory error at %p, wrote %08lx, read %08lx !\n",
+				 mem + i, 1UL << (i % 32), readback);
 
 			ret = -1;
 			break;
@@ -347,9 +343,8 @@ static int memory_post_test3(unsigned long start, unsigned long size)
 	for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
 		readback = mem[i];
 		if (readback != i) {
-			post_log("Memory error at %08x, "
-				  "wrote %08x, read %08x !\n",
-					  mem + i, i, readback);
+			post_log("Memory error at %p, wrote %08lx, read %08lx !\n",
+				 mem + i, i, readback);
 
 			ret = -1;
 			break;
@@ -377,9 +372,8 @@ static int memory_post_test4(unsigned long start, unsigned long size)
 	for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
 		readback = mem[i];
 		if (readback != ~i) {
-			post_log("Memory error at %08x, "
-				  "wrote %08x, read %08x !\n",
-					  mem + i, ~i, readback);
+			post_log("Memory error at %p, wrote %08lx, read %08lx !\n",
+				 mem + i, ~i, readback);
 
 			ret = -1;
 			break;
-- 
2.35.1.1320.gc452695387.dirty


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] post: memory: Fix format strings
  2022-08-23 19:10 [PATCH] post: memory: Fix format strings Sean Anderson
@ 2022-08-25  1:25 ` Simon Glass
  2022-09-15 14:02 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-08-25  1:25 UTC (permalink / raw)
  To: Sean Anderson; +Cc: Tom Rini, U-Boot Mailing List, Heiko Schocher

On Tue, 23 Aug 2022 at 12:11, Sean Anderson <sean.anderson@seco.com> wrote:
>
> This fixes numerous cases of format strings not matching their
> arguments. Also keep the format strings on one line for easier grepping.
>
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
>
>  post/drivers/memory.c | 30 ++++++++++++------------------
>  1 file changed, 12 insertions(+), 18 deletions(-)
>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] post: memory: Fix format strings
  2022-08-23 19:10 [PATCH] post: memory: Fix format strings Sean Anderson
  2022-08-25  1:25 ` Simon Glass
@ 2022-09-15 14:02 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-09-15 14:02 UTC (permalink / raw)
  To: Sean Anderson; +Cc: u-boot, hs

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

On Tue, Aug 23, 2022 at 03:10:39PM -0400, Sean Anderson wrote:

> This fixes numerous cases of format strings not matching their
> arguments. Also keep the format strings on one line for easier grepping.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-15 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23 19:10 [PATCH] post: memory: Fix format strings Sean Anderson
2022-08-25  1:25 ` Simon Glass
2022-09-15 14:02 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).