linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts: check.c fix compile error
@ 2017-05-15 19:10 Shuah Khan
  2017-05-16 12:52 ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2017-05-15 19:10 UTC (permalink / raw)
  To: robh+dt, frowand.list; +Cc: Shuah Khan, devicetree, linux-kernel

Fix the following compile error:

checks.c: In function ‘check_simple_bus_reg’:
checks.c:876:41: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 4 has type ‘uint64_t {aka
long long unsigned int}’ [-Werror=format=]
  snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
                                         ^
checks.c:876:41: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 4 has type ‘uint64_t
{aka long long unsigned int}’ [-Werror=format=]
cc1: all warnings being treated as errors
Makefile:304: recipe for target 'checks.o' failed
make: *** [checks.o] Error 1

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 scripts/dtc/checks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 5adfc8f..6dfb82f 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), "%lx", reg);
+	snprintf(unit_addr, sizeof(unit_addr), "%llx", 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

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

* Re: [PATCH] scripts: check.c fix compile error
  2017-05-15 19:10 [PATCH] scripts: check.c fix compile error Shuah Khan
@ 2017-05-16 12:52 ` Rob Herring
  2017-05-16 15:39   ` Shuah Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2017-05-16 12:52 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Frank Rowand, devicetree, linux-kernel

On Mon, May 15, 2017 at 2:10 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
> Fix the following compile error:

On what host? 32-bit I guess.

I'll take this, but can you also send this to upstream dtc and
devicetree-compiler list. Normally, dtc is just an import.

>
> checks.c: In function ‘check_simple_bus_reg’:
> checks.c:876:41: error: format ‘%lx’ expects argument of type
> ‘long unsigned int’, but argument 4 has type ‘uint64_t {aka
> long long unsigned int}’ [-Werror=format=]
>   snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
>                                          ^
> checks.c:876:41: error: format ‘%lx’ expects argument of type
> ‘long unsigned int’, but argument 4 has type ‘uint64_t
> {aka long long unsigned int}’ [-Werror=format=]
> cc1: all warnings being treated as errors
> Makefile:304: recipe for target 'checks.o' failed
> make: *** [checks.o] Error 1
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  scripts/dtc/checks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
> index 5adfc8f..6dfb82f 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), "%lx", reg);
> +       snprintf(unit_addr, sizeof(unit_addr), "%llx", 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] scripts: check.c fix compile error
  2017-05-16 12:52 ` Rob Herring
@ 2017-05-16 15:39   ` Shuah Khan
  2017-05-17 16:39     ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2017-05-16 15:39 UTC (permalink / raw)
  To: Rob Herring; +Cc: Frank Rowand, devicetree, linux-kernel, Shuah Khan

On 05/16/2017 06:52 AM, Rob Herring wrote:
> On Mon, May 15, 2017 at 2:10 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>> Fix the following compile error:
> 
> On what host? 32-bit I guess.

Saw this on Odroid-xu4.

> 
> I'll take this, but can you also send this to upstream dtc and
> devicetree-compiler list. Normally, dtc is just an import.

Yes. I found this on upstream dtc build last week and git the patch
ready to send. Then, I noticed that it showed up in 4.12-rc1 with the
dtc import. I have the patch ready to go for upstream dtc. Will send
it shortly.

thanks,
-- Shuah

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

* Re: [PATCH] scripts: check.c fix compile error
  2017-05-16 15:39   ` Shuah Khan
@ 2017-05-17 16:39     ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2017-05-17 16:39 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Frank Rowand, devicetree, linux-kernel

On Tue, May 16, 2017 at 10:39 AM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
> On 05/16/2017 06:52 AM, Rob Herring wrote:
>> On Mon, May 15, 2017 at 2:10 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>>> Fix the following compile error:
>>
>> On what host? 32-bit I guess.
>
> Saw this on Odroid-xu4.
>
>>
>> I'll take this, but can you also send this to upstream dtc and
>> devicetree-compiler list. Normally, dtc is just an import.
>
> Yes. I found this on upstream dtc build last week and git the patch
> ready to send. Then, I noticed that it showed up in 4.12-rc1 with the
> dtc import. I have the patch ready to go for upstream dtc. Will send
> it shortly.

I've cherry-picked the version from dtc and applied.

Rob

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

end of thread, other threads:[~2017-05-17 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 19:10 [PATCH] scripts: check.c fix compile error Shuah Khan
2017-05-16 12:52 ` Rob Herring
2017-05-16 15:39   ` Shuah Khan
2017-05-17 16:39     ` 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).