linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: fix i2c-i801.c printk format warning
       [not found] <20120806140109.b1a33b63686ef04f30139c9e@canb.auug.org.au>
@ 2012-08-06 16:10 ` Randy Dunlap
       [not found]   ` <501FEC87.6060506-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2012-08-06 16:10 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, LKML, linux-i2c, Jean Delvare (PC drivers, core),
	Mark Studebaker

From: Randy Dunlap <rdunlap@xenotime.net>

Fix printk format warning.  ARRAY_SIZE() uses sizeof(),
which is size_t, so use %zu to print it.

drivers/i2c/busses/i2c-i801.c: In function 'i801_add_mux':
drivers/i2c/busses/i2c-i801.c:1043:4: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'unsigned int'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Mark D. Studebaker <mdsxyz123@yahoo.com>
Cc: Jean Delvare <khali@linux-fr.org>
---
 drivers/i2c/busses/i2c-i801.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20120806.orig/drivers/i2c/busses/i2c-i801.c
+++ linux-next-20120806/drivers/i2c/busses/i2c-i801.c
@@ -1039,7 +1039,7 @@ static int __devinit i801_add_mux(struct
 
 	/* Find absolute GPIO pin numbers */
 	if (ARRAY_SIZE(priv->mux_priv) < mux_config->n_gpios) {
-		dev_err(dev, "i801_priv.mux_priv too small (%lu, need %d)\n",
+		dev_err(dev, "i801_priv.mux_priv too small (%zu, need %d)\n",
 			ARRAY_SIZE(priv->mux_priv), mux_config->n_gpios);
 		return -ENODEV;
 	}

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

* Re: [PATCH] i2c: fix i2c-i801.c printk format warning
       [not found]   ` <501FEC87.6060506-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
@ 2012-08-06 16:17     ` Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2012-08-06 16:17 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, linux-next-u79uwXL29TY76Z2rM5mHXA, LKML,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

Hi Randy,

On Mon, 06 Aug 2012 09:10:47 -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
> 
> Fix printk format warning.  ARRAY_SIZE() uses sizeof(),
> which is size_t, so use %zu to print it.
> 
> drivers/i2c/busses/i2c-i801.c: In function 'i801_add_mux':
> drivers/i2c/busses/i2c-i801.c:1043:4: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'unsigned int'
> 
> Signed-off-by: Randy Dunlap <rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
> Cc: Mark D. Studebaker <mdsxyz123-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
> Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-i801.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next-20120806.orig/drivers/i2c/busses/i2c-i801.c
> +++ linux-next-20120806/drivers/i2c/busses/i2c-i801.c
> @@ -1039,7 +1039,7 @@ static int __devinit i801_add_mux(struct
>  
>  	/* Find absolute GPIO pin numbers */
>  	if (ARRAY_SIZE(priv->mux_priv) < mux_config->n_gpios) {
> -		dev_err(dev, "i801_priv.mux_priv too small (%lu, need %d)\n",
> +		dev_err(dev, "i801_priv.mux_priv too small (%zu, need %d)\n",
>  			ARRAY_SIZE(priv->mux_priv), mux_config->n_gpios);
>  		return -ENODEV;
>  	}

Good catch once again, thanks a lot. As the offending patch is still
not upstream, I've folded your fix into it.

-- 
Jean Delvare

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

end of thread, other threads:[~2012-08-06 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20120806140109.b1a33b63686ef04f30139c9e@canb.auug.org.au>
2012-08-06 16:10 ` [PATCH] i2c: fix i2c-i801.c printk format warning Randy Dunlap
     [not found]   ` <501FEC87.6060506-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
2012-08-06 16:17     ` Jean Delvare

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