Skip to contentSkip to conversation

linux-next: build warning after merge of the mfd tree

PATCH In review Stephen Rothwell 4 participants 10 messages Nov 29, 2010 – Dec 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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/
#1 lore raw

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

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
index b141ca7..e6f7ebc 100644
@@ -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
#2 lore raw

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

Ick, ARRAY_SIZE is 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/
#3 lore raw

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

Ick, ARRAY_SIZE is 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).

#4 lore raw

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

Ick, ARRAY_SIZE is 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/
#5 lore raw

Re: [PATCH] cs5535-mfd: fix warning on x86-64

In reply to Andres Salomon
Quoted 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_64 allmodconfig) 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_SIZE is 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.

---
 drivers/mfd/cs5535-mfd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/cs5535-mfd.c +2 -2
index b141ca7..e6f7ebc 100644
@@ -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 ***

#6 lore raw

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

Quoted 7 lines
Quoted 3 lines

Ick, ARRAY_SIZE is 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.

Thanks Randy. I'll provide a new patch.

#7 lore raw

PATCH 1/1 cs5535-mfd: fix warning on x86-64 (v2)

In reply to Randy Dunlap

ARRAY_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
index b141ca7..59ca6f1 100644
@@ -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
Acked-by on v1 1/1
#8 lore raw

Re: [PATCH] cs5535-mfd: fix warning on x86-64 (v2)

Quoted 5 lines · Andres Salomon

ARRAY_SIZE() returns size_t; use %zu instead of %d so that we don't get warnings on x86-64.

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
index b141ca7..59ca6f1 100644
@@ -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 ***
#9 lore raw
In reply to Stephen Rothwell

Hi Stephen,

Quoted 10 lines · Stephen Rothwell

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

That should be fixed by now, thanks for the report.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/