From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: David Gibson
<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>,
Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH dtc] checks: Use proper format modifier for size_t
Date: Wed, 27 Sep 2017 15:04:09 +0200 [thread overview]
Message-ID: <20170927130409.9092-1-thierry.reding@gmail.com> (raw)
From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
The size of size_t can vary between architectures, so using %ld isn't
going to work on 32-bit builds. Use the %zu modifier to make sure it is
always correct.
Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
checks.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/checks.c b/checks.c
index 902f2e374025..08a3a29edae3 100644
--- a/checks.c
+++ b/checks.c
@@ -972,7 +972,7 @@ static void check_property_phandle_args(struct check *c,
int cell, cellsize = 0;
if (prop->val.len % sizeof(cell_t)) {
- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
+ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
prop->name, prop->val.len, sizeof(cell_t), node->fullpath);
return;
}
@@ -1163,7 +1163,7 @@ static void check_interrupts_property(struct check *c,
return;
if (irq_prop->val.len % sizeof(cell_t))
- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
+ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
irq_prop->name, irq_prop->val.len, sizeof(cell_t),
node->fullpath);
--
2.14.1
next reply other threads:[~2017-09-27 13:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 13:04 Thierry Reding [this message]
[not found] ` <20170927130409.9092-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-27 17:46 ` [PATCH dtc] checks: Use proper format modifier for size_t Rob Herring
[not found] ` <CAL_Jsq+egwxhx+9KxwQJBrYsBGMSV+NDmdBzWMfTs2Y0VE4Miw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-28 0:59 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170927130409.9092-1-thierry.reding@gmail.com \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jdl-CYoMK+44s/E@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).