mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
dtc: fix sprintf() format string error, again
2a42b14
"dtc: check.c fix compile error" changed a format string using
%lx which wasn't correct for all platforms. Unfortunately it changed it to
%zx, which is wrong for a different set of platforms (and only right on
the others by accident). The parameter we're formatting here is uint64_t,
not size_t, so we need to use the PRIx64 macro from <inttypes.h> to get
this right.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d990b80138
commit
13ce6e1c2f
2 changed files with 2 additions and 1 deletions
2
checks.c
2
checks.c
|
@ -873,7 +873,7 @@ static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct no
|
|||
while (size--)
|
||||
reg = (reg << 32) | fdt32_to_cpu(*(cells++));
|
||||
|
||||
snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
|
||||
snprintf(unit_addr, sizeof(unit_addr), "%"PRIx64, reg);
|
||||
if (!streq(unitname, unit_addr))
|
||||
FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",
|
||||
node->fullpath, unit_addr);
|
||||
|
|
1
dtc.h
1
dtc.h
|
@ -31,6 +31,7 @@
|
|||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <libfdt_env.h>
|
||||
#include <fdt.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue