devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/dtc: fix '%zx' warning
@ 2017-07-25 16:20 Russell King
       [not found] ` <E1da2Z7-0008GG-AV-eh5Bv4kxaXIk46pC+1QYvQNdhmdF6hFW@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King @ 2017-07-25 16:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Shuah Khan, David Gibson, Frank Rowand,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
---
 scripts/dtc/checks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I've been carrying this patch for some time, but I guess hardly anyone
builds DT based kernels on 32-bit x86 boxes anymore as it has remained
unfixed.

diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 4b72b530c84f..62ea8f83d4a0 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/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), "%llx", (unsigned long long)reg);
 	if (!streq(unitname, unit_addr))
 		FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",
 		     node->fullpath, unit_addr);
-- 
2.7.4

--
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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found] ` <E1da2Z7-0008GG-AV-eh5Bv4kxaXIk46pC+1QYvQNdhmdF6hFW@public.gmane.org>
@ 2017-07-26  1:30   ` David Gibson
       [not found]     ` <20170726013004.GJ8978-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: David Gibson @ 2017-07-26  1:30 UTC (permalink / raw)
  To: Russell King
  Cc: Rob Herring, Shuah Khan, Frank Rowand,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]

On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
> 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>

This (embarrassing) error is already fixed in upstream dtc.

> ---
>  scripts/dtc/checks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I've been carrying this patch for some time, but I guess hardly anyone
> builds DT based kernels on 32-bit x86 boxes anymore as it has remained
> unfixed.
> 
> diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
> index 4b72b530c84f..62ea8f83d4a0 100644
> --- a/scripts/dtc/checks.c
> +++ b/scripts/dtc/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), "%llx", (unsigned long long)reg);
>  	if (!streq(unitname, unit_addr))
>  		FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",
>  		     node->fullpath, unit_addr);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found]     ` <20170726013004.GJ8978-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
@ 2017-08-08 11:28       ` Russell King - ARM Linux
       [not found]         ` <20170808112818.GC20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2017-08-08 11:28 UTC (permalink / raw)
  To: David Gibson, Linus Torvalds
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Frank Rowand,
	Shuah Khan, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
> On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
> > 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
> 
> 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.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found]         ` <20170808112818.GC20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
@ 2017-08-09  4:06           ` David Gibson
       [not found]             ` <20170809040642.GG13670-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: David Gibson @ 2017-08-09  4:06 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Linus Torvalds, devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
	Frank Rowand, Shuah Khan,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]

On Tue, Aug 08, 2017 at 12:28:19PM +0100, Russell King - ARM Linux wrote:
> On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
> > On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
> > > 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
> > 
> > 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.

Um.. I don't know.  I haven't been the person doing updates of the
kernel dtc to match upstream dtc for ages.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found]             ` <20170809040642.GG13670-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
@ 2017-08-31 15:58               ` Rob Herring
       [not found]                 ` <CAL_JsqKiM_T-ftd8NvHmzcRsirRWTe34jZRjZ=3NGSgb4HGncQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2017-08-31 15:58 UTC (permalink / raw)
  To: David Gibson
  Cc: Russell King - ARM Linux, Linus Torvalds,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand,
	Shuah Khan,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

On Tue, Aug 8, 2017 at 11:06 PM, David Gibson
<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> On Tue, Aug 08, 2017 at 12:28:19PM +0100, Russell King - ARM Linux wrote:
>> On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
>> > On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
>> > > 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
>> >
>> > 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.

> Um.. I don't know.  I haven't been the person doing updates of the
> kernel dtc to match upstream dtc for ages.

The flow is submit a patch to upstream dtc on
devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org and then bug me to cherry-pick or
sync dtc.

I will cherry-pick the upstream version.

Rob
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found]                 ` <CAL_JsqKiM_T-ftd8NvHmzcRsirRWTe34jZRjZ=3NGSgb4HGncQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-08-31 16:16                   ` Russell King - ARM Linux
       [not found]                     ` <20170831161611.GT20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2017-08-31 16:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: David Gibson, Linus Torvalds,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand,
	Shuah Khan,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

On Thu, Aug 31, 2017 at 10:58:12AM -0500, Rob Herring wrote:
> On Tue, Aug 8, 2017 at 11:06 PM, David Gibson
> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> > On Tue, Aug 08, 2017 at 12:28:19PM +0100, Russell King - ARM Linux wrote:
> >> On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
> >> > On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
> >> > > 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
> >> >
> >> > 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?

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found]                     ` <20170831161611.GT20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
@ 2017-08-31 17:01                       ` Rob Herring
       [not found]                         ` <CAL_Jsq+1gMR2MCEXA6UOiK+4NpxT4k71YGqWzW7hZNCWnRg0hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2017-08-31 17:01 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: David Gibson, Linus Torvalds,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand,
	Shuah Khan,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

On Thu, Aug 31, 2017 at 11:16 AM, Russell King - ARM Linux
<linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org> wrote:
> On Thu, Aug 31, 2017 at 10:58:12AM -0500, Rob Herring wrote:
>> On Tue, Aug 8, 2017 at 11:06 PM, David Gibson
>> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
>> > On Tue, Aug 08, 2017 at 12:28:19PM +0100, Russell King - ARM Linux wrote:
>> >> On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
>> >> > On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
>> >> > > 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
>> >> >
>> >> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] scripts/dtc: fix '%zx' warning
       [not found]                         ` <CAL_Jsq+1gMR2MCEXA6UOiK+4NpxT4k71YGqWzW7hZNCWnRg0hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-09-01 14:08                           ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-09-01 14:08 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: David Gibson, Linus Torvalds,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand,
	Shuah Khan,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

On Thu, Aug 31, 2017 at 12:01 PM, Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Thu, Aug 31, 2017 at 11:16 AM, Russell King - ARM Linux
> <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org> wrote:
>> On Thu, Aug 31, 2017 at 10:58:12AM -0500, Rob Herring wrote:
>>> On Tue, Aug 8, 2017 at 11:06 PM, David Gibson
>>> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
>>> > On Tue, Aug 08, 2017 at 12:28:19PM +0100, Russell King - ARM Linux wrote:
>>> >> On Wed, Jul 26, 2017 at 11:30:04AM +1000, David Gibson wrote:
>>> >> > On Tue, Jul 25, 2017 at 05:20:09PM +0100, Russell King wrote:
>>> >> > > 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 <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
>>> >> >
>>> >> > 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.

Well, your fix went in before I got the cherry-pick sent to Linus.
Still, let me know if there's any issue with the upstream fix because
when I sync dtc this fix is going to be overwritten with upstream.

Rob
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-01 14:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 16:20 [PATCH] scripts/dtc: fix '%zx' warning Russell King
     [not found] ` <E1da2Z7-0008GG-AV-eh5Bv4kxaXIk46pC+1QYvQNdhmdF6hFW@public.gmane.org>
2017-07-26  1:30   ` David Gibson
     [not found]     ` <20170726013004.GJ8978-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-08-08 11:28       ` Russell King - ARM Linux
     [not found]         ` <20170808112818.GC20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2017-08-09  4:06           ` David Gibson
     [not found]             ` <20170809040642.GG13670-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-08-31 15:58               ` Rob Herring
     [not found]                 ` <CAL_JsqKiM_T-ftd8NvHmzcRsirRWTe34jZRjZ=3NGSgb4HGncQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-31 16:16                   ` Russell King - ARM Linux
     [not found]                     ` <20170831161611.GT20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2017-08-31 17:01                       ` Rob Herring
     [not found]                         ` <CAL_Jsq+1gMR2MCEXA6UOiK+4NpxT4k71YGqWzW7hZNCWnRg0hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-01 14:08                           ` Rob Herring

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).