Thread (1 message) 1 message, 1 author, 2017-08-31

Re: [PATCH] scripts/dtc: fix '%zx' warning

From: Rob Herring <hidden>
Date: 2017-08-31 17:01:40
Also in: linux-arm-kernel

On Thu, Aug 31, 2017 at 11:16 AM, Russell King - ARM Linux
[off-list ref] wrote:
On Thu, Aug 31, 2017 at 10:58:12AM -0500, Rob Herring wrote:
quoted
On Tue, Aug 8, 2017 at 11:06 PM, David Gibson
[off-list ref] wrote:
quoted
On Tue, Aug 08, 2017 at 12:28:19PM +0100, Russell King - ARM Linux wrote:
quoted
On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
quoted
On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
quoted
dtc uses an incorrect format specifier for printing a uint64_t value.
uint64_t may be either 'unsigned long' or 'unsigned long long' depending
on the host architecture.

Fix this by using %llx and casting to unsigned long long, which ensures
that we always have a wide enough variable to print 64 bits of hex.

  HOSTCC  scripts/dtc/checks.o
scripts/dtc/checks.c: In function 'check_simple_bus_reg':
scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]
  snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
  ^
scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]

Fixes: 828d4cdd012c ("dtc: check.c fix compile error")
Signed-off-by: Russell King <redacted>
This (embarrassing) error is already fixed in upstream dtc.
It remains unfixed in 4.13-rc4.  How do we get this fixed in the
kernel's dtc?  From what I can see, sending a patch to fix stuff
doesn't work.
Sorry, didn't see this until Andrew M picked it up.
How do we know whether whatever is in upstream dtc fixes the problem
that I'm seeing?
Build upstream dtc or here's a branch[1] with the cherry-picked fix.

Rob

[1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git dt/testing
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help