f3da2d1
From 46ed9702a0005da87edd0cc3d34dbe24d1526784 Mon Sep 17 00:00:00 2001
f3da2d1
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
f3da2d1
Date: Thu, 6 Jun 2013 17:01:39 +0200
f3da2d1
Subject: [PATCH] use tx as the type specifier instead of zx
f3da2d1
f3da2d1
A couple of printf() commands use "zx" as a type specifier for printing
f3da2d1
a difference of 2 pointers. "z" means a size_t, but using "t" which is
f3da2d1
ptrdiff_t is correct. The issue was found on s390 (32-bit) where size_t
f3da2d1
is defined as "unsigned long" as opposed to the usual "unsigned int".
f3da2d1
---
f3da2d1
 fdtdump.c | 10 +++++-----
f3da2d1
 1 file changed, 5 insertions(+), 5 deletions(-)
f3da2d1
f3da2d1
diff --git a/fdtdump.c b/fdtdump.c
f3da2d1
index 723770d..c5811f0 100644
f3da2d1
--- a/fdtdump.c
f3da2d1
+++ b/fdtdump.c
f3da2d1
@@ -95,7 +95,7 @@ static void dump_blob(void *blob, bool debug)
f3da2d1
 	p = p_struct;
f3da2d1
 	while ((tag = fdt32_to_cpu(GET_CELL(p))) != FDT_END) {
f3da2d1
 
f3da2d1
-		dumpf("%04zx: tag: 0x%08x (%s)\n",
f3da2d1
+		dumpf("%04tx: tag: 0x%08x (%s)\n",
f3da2d1
 		        (uintptr_t)p - blob_off - 4, tag, tagname(tag));
f3da2d1
 
f3da2d1
 		if (tag == FDT_BEGIN_NODE) {
f3da2d1
@@ -135,8 +135,8 @@ static void dump_blob(void *blob, bool debug)
f3da2d1
 
f3da2d1
 		p = PALIGN(p + sz, 4);
f3da2d1
 
f3da2d1
-		dumpf("%04zx: string: %s\n", (uintptr_t)s - blob_off, s);
f3da2d1
-		dumpf("%04zx: value\n", (uintptr_t)t - blob_off);
f3da2d1
+		dumpf("%04tx: string: %s\n", (uintptr_t)s - blob_off, s);
f3da2d1
+		dumpf("%04tx: value\n", (uintptr_t)t - blob_off);
f3da2d1
 		printf("%*s%s", depth * shift, "", s);
f3da2d1
 		utilfdt_print_data(t, sz);
f3da2d1
 		printf(";\n");
f3da2d1
@@ -210,14 +210,14 @@ int main(int argc, char *argv[])
f3da2d1
 					fdt_off_dt_strings(p) < this_len)
f3da2d1
 					break;
f3da2d1
 				if (debug)
f3da2d1
-					printf("%s: skipping fdt magic at offset %#zx\n",
f3da2d1
+					printf("%s: skipping fdt magic at offset %#tx\n",
f3da2d1
 						file, p - buf);
f3da2d1
 			}
f3da2d1
 			++p;
f3da2d1
 		}
f3da2d1
 		if (!p)
f3da2d1
 			die("%s: could not locate fdt magic\n", file);
f3da2d1
-		printf("%s: found fdt at offset %#zx\n", file, p - buf);
f3da2d1
+		printf("%s: found fdt at offset %#tx\n", file, p - buf);
f3da2d1
 		buf = p;
f3da2d1
 	}
f3da2d1
 
f3da2d1
-- 
f3da2d1
1.8.1.4
f3da2d1