blob: cab384dd99ad3214351c793bc0e7a32e8e8bc15e [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From c7a4c3817796107bb824a1f173faf90fae45396b Mon Sep 17 00:00:00 2001
2From: Thierry Reding <treding@nvidia.com>
3Date: Wed, 27 Sep 2017 15:04:09 +0200
4Subject: [PATCH] checks: Use proper format modifier for size_t
5
6The size of size_t can vary between architectures, so using %ld isn't
7going to work on 32-bit builds. Use the %zu modifier to make sure it is
8always correct.
9
10Upstream-Status: Backport
11Signed-off-by: Thierry Reding <treding@nvidia.com>
12Acked-by: Rob Herring <robh@kernel.org>
13Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
14Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
15---
16 checks.c | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/checks.c b/checks.c
20index 902f2e3..08a3a29 100644
21--- a/checks.c
22+++ b/checks.c
23@@ -972,7 +972,7 @@ static void check_property_phandle_args(struct check *c,
24 int cell, cellsize = 0;
25
26 if (prop->val.len % sizeof(cell_t)) {
27- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
28+ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
29 prop->name, prop->val.len, sizeof(cell_t), node->fullpath);
30 return;
31 }
32@@ -1163,7 +1163,7 @@ static void check_interrupts_property(struct check *c,
33 return;
34
35 if (irq_prop->val.len % sizeof(cell_t))
36- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
37+ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
38 irq_prop->name, irq_prop->val.len, sizeof(cell_t),
39 node->fullpath);
40
41--
422.15.0
43