dtc/use-tx-as-the-type-specifier-instead-of-zx.patch
Dirk Mueller 33a3223398 Accepting request 478805 from home:pluskalm:branches:Base:System
- Update to version 1.4.4:
  * fdtput: Remove star from value_len documentation
  * fdtget: Use @return to document the return value
  * tests: Make realloc_fdt() really allocate *fdt
  * libfdt: overlay: Check the value of the right variable
  * dtc: Simplify asm_emit_string() implementation
  * libfdt: Change names of sparse helper macros
  * Fix assorted sparse warnings
  * Clean up gcc attributes
  * dtc: Don't abuse struct fdt_reserve_entry
- Refresh patches
- Make building more verbose
- Run tests

OBS-URL: https://build.opensuse.org/request/show/478805
OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=30
2017-03-16 08:38:03 +00:00

55 lines
2.0 KiB
Diff

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