linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the mfd tree
@ 2010-11-29  0:52 Stephen Rothwell
  2010-11-30  4:44 ` [PATCH] cs5535-mfd: fix warning on x86-64 Andres Salomon
  2010-11-30 10:02 ` linux-next: build warning after merge of the mfd tree Samuel Ortiz
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Rothwell @ 2010-11-29  0:52 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Andres Salomon

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

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

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* [PATCH] cs5535-mfd: fix warning on x86-64
  2010-11-29  0:52 linux-next: build warning after merge of the mfd tree Stephen Rothwell
@ 2010-11-30  4:44 ` Andres Salomon
  2010-11-30 10:01   ` Samuel Ortiz
  2010-11-30 18:22   ` Randy Dunlap
  2010-11-30 10:02 ` linux-next: build warning after merge of the mfd tree Samuel Ortiz
  1 sibling, 2 replies; 10+ messages in thread
From: Andres Salomon @ 2010-11-30  4:44 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Samuel Ortiz, linux-next, linux-kernel

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

On Mon, 29 Nov 2010 11:52:57 +1100
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> 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 <dilinger@queued.net>

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 <dilinger@queued.net>
---
 drivers/mfd/cs5535-mfd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
index b141ca7..e6f7ebc 100644
--- a/drivers/mfd/cs5535-mfd.c
+++ b/drivers/mfd/cs5535-mfd.c
@@ -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;
 
-- 
1.7.2.3


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

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

* Re: [PATCH] cs5535-mfd: fix warning on x86-64
  2010-11-30  4:44 ` [PATCH] cs5535-mfd: fix warning on x86-64 Andres Salomon
@ 2010-11-30 10:01   ` Samuel Ortiz
  2010-12-07 18:38     ` Andres Salomon
  2010-11-30 18:22   ` Randy Dunlap
  1 sibling, 1 reply; 10+ messages in thread
From: Samuel Ortiz @ 2010-11-30 10:01 UTC (permalink / raw)
  To: Andres Salomon; +Cc: Stephen Rothwell, linux-next, linux-kernel

Hi Andres,

On Mon, Nov 29, 2010 at 08:44:10PM -0800, Andres Salomon wrote:
> On Mon, 29 Nov 2010 11:52:57 +1100
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> > 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 <dilinger@queued.net>
> 
> 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.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: linux-next: build warning after merge of the mfd tree
  2010-11-29  0:52 linux-next: build warning after merge of the mfd tree Stephen Rothwell
  2010-11-30  4:44 ` [PATCH] cs5535-mfd: fix warning on x86-64 Andres Salomon
@ 2010-11-30 10:02 ` Samuel Ortiz
  1 sibling, 0 replies; 10+ messages in thread
From: Samuel Ortiz @ 2010-11-30 10:02 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Andres Salomon

Hi Stephen,

On Mon, Nov 29, 2010 at 11:52:57AM +1100, Stephen Rothwell wrote:
> 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.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: [PATCH] cs5535-mfd: fix warning on x86-64
  2010-11-30  4:44 ` [PATCH] cs5535-mfd: fix warning on x86-64 Andres Salomon
  2010-11-30 10:01   ` Samuel Ortiz
@ 2010-11-30 18:22   ` Randy Dunlap
  2010-11-30 21:44     ` Andres Salomon
  2010-11-30 21:54     ` [PATCH] cs5535-mfd: fix warning on x86-64 (v2) Andres Salomon
  1 sibling, 2 replies; 10+ messages in thread
From: Randy Dunlap @ 2010-11-30 18:22 UTC (permalink / raw)
  To: Andres Salomon; +Cc: Stephen Rothwell, Samuel Ortiz, linux-next, linux-kernel

On Mon, 29 Nov 2010 20:44:10 -0800 Andres Salomon wrote:

> On Mon, 29 Nov 2010 11:52:57 +1100
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> > 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.
> 

No, it's a sizeof(), so it should be printed with %zd.
That works on x86_64 or i386.

> 
> 
> 
> From: Andres Salomon <dilinger@queued.net>
> 
> 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 <dilinger@queued.net>
> ---
>  drivers/mfd/cs5535-mfd.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
> index b141ca7..e6f7ebc 100644
> --- a/drivers/mfd/cs5535-mfd.c
> +++ b/drivers/mfd/cs5535-mfd.c
> @@ -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;
>  
> -- 
> 1.7.2.3
> 


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] cs5535-mfd: fix warning on x86-64
  2010-11-30 18:22   ` Randy Dunlap
@ 2010-11-30 21:44     ` Andres Salomon
  2010-11-30 21:54     ` [PATCH] cs5535-mfd: fix warning on x86-64 (v2) Andres Salomon
  1 sibling, 0 replies; 10+ messages in thread
From: Andres Salomon @ 2010-11-30 21:44 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, Samuel Ortiz, linux-next, linux-kernel

On Tue, 30 Nov 2010 10:22:57 -0800
Randy Dunlap <randy.dunlap@oracle.com> wrote:

> On Mon, 29 Nov 2010 20:44:10 -0800 Andres Salomon wrote:
> 
> > On Mon, 29 Nov 2010 11:52:57 +1100
> > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > > 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.
> > 
> 
> 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.

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

* [PATCH] cs5535-mfd: fix warning on x86-64 (v2)
  2010-11-30 18:22   ` Randy Dunlap
  2010-11-30 21:44     ` Andres Salomon
@ 2010-11-30 21:54     ` Andres Salomon
  2010-11-30 22:36       ` Randy Dunlap
  1 sibling, 1 reply; 10+ messages in thread
From: Andres Salomon @ 2010-11-30 21:54 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Randy Dunlap, Stephen Rothwell, linux-next, linux-kernel


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

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/cs5535-mfd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
index b141ca7..59ca6f1 100644
--- a/drivers/mfd/cs5535-mfd.c
+++ b/drivers/mfd/cs5535-mfd.c
@@ -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;
-- 
1.7.2.3

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

* Re: [PATCH] cs5535-mfd: fix warning on x86-64 (v2)
  2010-11-30 21:54     ` [PATCH] cs5535-mfd: fix warning on x86-64 (v2) Andres Salomon
@ 2010-11-30 22:36       ` Randy Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2010-11-30 22:36 UTC (permalink / raw)
  To: Andres Salomon; +Cc: Samuel Ortiz, Stephen Rothwell, linux-next, linux-kernel

On 11/30/10 13:54, Andres Salomon wrote:
> 
> ARRAY_SIZE() returns size_t; use %zu instead of %d so that we don't
> get warnings on x86-64.
> 
> Signed-off-by: Andres Salomon <dilinger@queued.net>

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

Glad you used %zu instead of %zd.

> ---
>  drivers/mfd/cs5535-mfd.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
> index b141ca7..59ca6f1 100644
> --- a/drivers/mfd/cs5535-mfd.c
> +++ b/drivers/mfd/cs5535-mfd.c
> @@ -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;


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] cs5535-mfd: fix warning on x86-64
  2010-11-30 10:01   ` Samuel Ortiz
@ 2010-12-07 18:38     ` Andres Salomon
  2010-12-09 11:49       ` Samuel Ortiz
  0 siblings, 1 reply; 10+ messages in thread
From: Andres Salomon @ 2010-12-07 18:38 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Stephen Rothwell, linux-next, linux-kernel

On Tue, 30 Nov 2010 11:01:38 +0100
Samuel Ortiz <sameo@linux.intel.com> wrote:

> Hi Andres,
> 
> On Mon, Nov 29, 2010 at 08:44:10PM -0800, Andres Salomon wrote:
> > On Mon, 29 Nov 2010 11:52:57 +1100
> > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > > 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 <dilinger@queued.net>
> > 
> > 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).

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

* Re: [PATCH] cs5535-mfd: fix warning on x86-64
  2010-12-07 18:38     ` Andres Salomon
@ 2010-12-09 11:49       ` Samuel Ortiz
  0 siblings, 0 replies; 10+ messages in thread
From: Samuel Ortiz @ 2010-12-09 11:49 UTC (permalink / raw)
  To: Andres Salomon; +Cc: Stephen Rothwell, linux-next, linux-kernel

Hi Andres,

On Tue, Dec 07, 2010 at 10:38:06AM -0800, Andres Salomon wrote:
> On Tue, 30 Nov 2010 11:01:38 +0100
> Samuel Ortiz <sameo@linux.intel.com> wrote:
> 
> > Hi Andres,
> > 
> > On Mon, Nov 29, 2010 at 08:44:10PM -0800, Andres Salomon wrote:
> > > On Mon, 29 Nov 2010 11:52:57 +1100
> > > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > 
> > > > 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 <dilinger@queued.net>
> > > 
> > > 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.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2010-12-09 11:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29  0:52 linux-next: build warning after merge of the mfd tree Stephen Rothwell
2010-11-30  4:44 ` [PATCH] cs5535-mfd: fix warning on x86-64 Andres Salomon
2010-11-30 10:01   ` Samuel Ortiz
2010-12-07 18:38     ` Andres Salomon
2010-12-09 11:49       ` Samuel Ortiz
2010-11-30 18:22   ` Randy Dunlap
2010-11-30 21:44     ` Andres Salomon
2010-11-30 21:54     ` [PATCH] cs5535-mfd: fix warning on x86-64 (v2) Andres Salomon
2010-11-30 22:36       ` Randy Dunlap
2010-11-30 10:02 ` linux-next: build warning after merge of the mfd tree Samuel Ortiz

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