linux-next: build warning after merge of the mfd tree
Subsystems (2)
Hi Samuel,
After merging the mfd tree, today's linux-next build (x86_64 allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
Introduced by commit a0d4503a044e67ac46adfe8f42eddefd2b60f85e ("mfd: Add cs5535-mfd driver for AMD Geode's CS5535/CS5536 support").
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
PATCH 1/1 cs5535-mfd: fix warning on x86-64
Quoted 9 lines · On Mon, 29 Nov 2010 11:52:57 +1100 Stephen Rothwell <[email protected]>…
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
Ick, ARRAY_SIZE is unsigned int on x86, unsigned long on x86-64. The patch below fixes this.
From: Andres Salomon <[email protected]>
ARRAY_SIZE() returns unsigned long on x86-64 (rather than unsigned int); cast it to the desired type to shut gcc up.
--- drivers/mfd/cs5535-mfd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/cs5535-mfd.c +2 -2
@@ -103,8 +103,8 @@ static int __devinit cs5535_mfd_probe(struct pci_dev *pdev, goto err_disable; } -dev_info (&pdev->dev,"%d devices registered.\n" , -ARRAY_SIZE (cs5535_mfd_cells)); +dev_info (&pdev->dev,"%u devices registered.\n" , + (unsigned int )ARRAY_SIZE (cs5535_mfd_cells));return 0 ;
Signature · 1 line
1.7.2.3
Re: [PATCH] cs5535-mfd: fix warning on x86-64
Hi Andres,
Quoted 19 lines · Andres Salomon
Quoted 9 lines · On Mon, 29 Nov 2010 11:52:57 +1100 Stephen Rothwell <[email protected]>…
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'Ick,
ARRAY_SIZEis unsigned int on x86, unsigned long on x86-64. The patch below fixes this.
Quoted 4 lines
From: Andres Salomon <[email protected]>
ARRAY_SIZE()returns unsigned long on x86-64 (rather than unsigned int); cast it to the desired type to shut gcc up.
Patch applied, many thanks.
I'll look at your subdevices patches by the end of this week.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/
Re: [PATCH] cs5535-mfd: fix warning on x86-64
Quoted 22 lines · On Tue, 30 Nov 2010 11:01:38 +0100 Samuel Ortiz <[email protected]> wrote:
Hi Andres,
Quoted 19 lines · Andres Salomon
Quoted 9 lines · On Mon, 29 Nov 2010 11:52:57 +1100 Stephen Rothwell <[email protected]>…
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'Ick,
ARRAY_SIZEis unsigned int on x86, unsigned long on x86-64. The patch below fixes this.
Quoted 7 lines
Quoted 4 lines
From: Andres Salomon <[email protected]>
ARRAY_SIZE()returns unsigned long on x86-64 (rather than unsigned int); cast it to the desired type to shut gcc up.Patch applied, many thanks.
I'll look at your subdevices patches by the end of this week.
Did you get the chance to look at them? Also, note that there's an updated patch for the cs5535-mfd warnings (v2, acked by Randy).
Re: [PATCH] cs5535-mfd: fix warning on x86-64
Hi Andres,
Quoted 27 lines · Andres Salomon
Quoted 24 lines · On Tue, 30 Nov 2010 11:01:38 +0100 Samuel Ortiz <[email protected]> wrote:
Hi Andres,
Quoted 21 lines · Andres Salomon
Quoted 9 lines · On Mon, 29 Nov 2010 11:52:57 +1100 Stephen Rothwell <[email protected]>…
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'Ick,
ARRAY_SIZEis unsigned int on x86, unsigned long on x86-64. The patch below fixes this.From: Andres Salomon <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
ARRAY_SIZE()returns unsigned long on x86-64 (rather than unsigned int); cast it to the desired type to shut gcc up.Patch applied, many thanks.
I'll look at your subdevices patches by the end of this week.Did you get the chance to look at them? Also, note that there's an updated patch for the cs5535-mfd warnings (v2, acked by Randy).
Yes, I've taken this one, along with the gpio and misc subdevices drivers.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/
Re: [PATCH] cs5535-mfd: fix warning on x86-64
In reply to Andres SalomonQuoted 8 lines · On Mon, 29 Nov 2010 20:44:10 -0800 Andres Salomon wrote:
Quoted 5 lines · On Mon, 29 Nov 2010 11:52:57 +1100 Stephen Rothwell <[email protected]>…
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
Quoted 8 lines
Quoted 4 lines
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'Ick,
ARRAY_SIZEis unsigned int on x86, unsigned long on x86-64. The patch below fixes this.
No, it's a sizeof(), so it should be printed with %zd. That works on x86_64 or i386.
Quoted 31 lines
From: Andres Salomon <[email protected]>
ARRAY_SIZE()returns unsigned long on x86-64 (rather than unsigned int); cast it to the desired type to shut gcc up.Signed-off-by Andres Salomon <[email protected]>--- drivers/mfd/cs5535-mfd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/mfd/cs5535-mfd.c +2
-2@@ -103,8 +103,8 @@ static int __devinit cs5535_mfd_probe(struct pci_dev *pdev, goto err_disable; } -dev_info (&pdev->dev,"%d devices registered.\n" , -ARRAY_SIZE (cs5535_mfd_cells)); +dev_info (&pdev->dev,"%u devices registered.\n" , + (unsigned int )ARRAY_SIZE (cs5535_mfd_cells));return 0 ;Signature · 1 line
1.7.2.3
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Re: [PATCH] cs5535-mfd: fix warning on x86-64
Quoted 15 lines · On Tue, 30 Nov 2010 10:22:57 -0800 Randy Dunlap <[email protected]> wrote:
Quoted 13 lines · On Mon, 29 Nov 2010 20:44:10 -0800 Andres Salomon wrote:
Quoted 9 lines · On Mon, 29 Nov 2010 11:52:57 +1100 Stephen Rothwell <[email protected]>…
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
Quoted 7 lines
Quoted 3 lines
Ick,
ARRAY_SIZEis unsigned int on x86, unsigned long on x86-64. The patch below fixes this.No, it's a
sizeof(), so it should be printed with %zd. That works onx86_64or i386.
Thanks Randy. I'll provide a new patch.
PATCH 1/1 cs5535-mfd: fix warning on x86-64 (v2)
In reply to Randy DunlapARRAY_SIZE() returns size_t; use %zu instead of %d so that we don't get warnings on x86-64.
--- drivers/mfd/cs5535-mfd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/cs5535-mfd.c +1 -1
@@ -103,7 +103,7 @@ static int __devinit cs5535_mfd_probe(struct pci_dev *pdev, goto err_disable; } -dev_info (&pdev->dev,"%d devices registered.\n" , +dev_info (&pdev->dev,"%zu devices registered.\n" ,ARRAY_SIZE (cs5535_mfd_cells));return 0 ;
Signature · 1 line
1.7.2.3
Re: [PATCH] cs5535-mfd: fix warning on x86-64 (v2)
Quoted 5 lines · Andres Salomon
ARRAY_SIZE()returnssize_t; use %zu instead of %d so that we don't get warnings on x86-64.Signed-off-by Andres Salomon <[email protected]>
Glad you used %zu instead of %zd.
Quoted 17 lines
--- drivers/mfd/cs5535-mfd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mfd/cs5535-mfd.c +1
-1@@ -103,7 +103,7 @@ static int __devinit cs5535_mfd_probe(struct pci_dev *pdev, goto err_disable; } -dev_info (&pdev->dev,"%d devices registered.\n" , +dev_info (&pdev->dev,"%zu devices registered.\n" ,ARRAY_SIZE (cs5535_mfd_cells));return 0 ;
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***
Hi Stephen,
Quoted 10 lines · Stephen Rothwell
Hi Samuel,
After merging the mfd tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
drivers/mfd/cs5535-mfd.c: In function 'cs5535_mfd_probe':drivers/mfd/cs5535-mfd.c:106: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'Introduced by commit
a0d4503a044e67ac46adfe8f42eddefd2b60f85e("mfd: Add cs5535-mfd driver for AMD Geode's CS5535/CS5536 support").
That should be fixed by now, thanks for the report.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/