public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
@ 2008-01-04 22:05 Miguel Botón
  2008-01-04 22:13 ` Roland Dreier
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Miguel Botón @ 2008-01-04 22:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-wireless, yi.zhu, linville

This patch fixes a compilation warning in 'iwl-4965.c'.

Signed-off-by: Miguel Botón <mboton@gmail.com>

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 74999af..92237cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_priv *priv,
 	if (skb_headroom(skb) < sizeof(*iwl4965_rt)) {
 		if (net_ratelimit())
 			printk(KERN_ERR "not enough headroom [%d] for "
-			       "radiotap head [%d]\n",
+			       "radiotap head [%ld]\n",
 			       skb_headroom(skb), sizeof(*iwl4965_rt));
 		return;
 	}

-- 
	Miguel Botón

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

* Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
  2008-01-04 22:05 [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c' Miguel Botón
@ 2008-01-04 22:13 ` Roland Dreier
  2008-01-04 22:31   ` David Miller
  2008-01-04 22:15 ` Randy Dunlap
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Roland Dreier @ 2008-01-04 22:13 UTC (permalink / raw)
  To: Miguel Botón; +Cc: linux-kernel, linux-wireless, yi.zhu, linville

 > -			       "radiotap head [%d]\n",
 > +			       "radiotap head [%ld]\n",
 >  			       skb_headroom(skb), sizeof(*iwl4965_rt));

Actually I think the correct printf format for printing a size_t
(coming here from sizeof foo) is "%zd".  Otherwise you'll fix the
warning on 64-bit targets but add a new warning on 32-bit targets.

 - R.

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

* Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
  2008-01-04 22:05 [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c' Miguel Botón
  2008-01-04 22:13 ` Roland Dreier
@ 2008-01-04 22:15 ` Randy Dunlap
  2008-01-04 22:15 ` Michael Buesch
  2008-01-04 22:34 ` Miguel Botón
  3 siblings, 0 replies; 6+ messages in thread
From: Randy Dunlap @ 2008-01-04 22:15 UTC (permalink / raw)
  To: Miguel Botón; +Cc: linux-kernel, linux-wireless, yi.zhu, linville

On Fri, 4 Jan 2008 23:05:54 +0100 Miguel Botón wrote:

> This patch fixes a compilation warning in 'iwl-4965.c'.

It would be helpful to have the warning message right here.<---

> Signed-off-by: Miguel Botón <mboton@gmail.com>
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
> index 74999af..92237cd 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
> @@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_priv *priv,
>  	if (skb_headroom(skb) < sizeof(*iwl4965_rt)) {
>  		if (net_ratelimit())
>  			printk(KERN_ERR "not enough headroom [%d] for "
> -			       "radiotap head [%d]\n",
> +			       "radiotap head [%ld]\n",
>  			       skb_headroom(skb), sizeof(*iwl4965_rt));
>  		return;
>  	}

sizeof() (or size_t) normally needs %zd.

---
~Randy
desserts:  http://www.xenotime.net/linux/recipes/

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

* Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
  2008-01-04 22:05 [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c' Miguel Botón
  2008-01-04 22:13 ` Roland Dreier
  2008-01-04 22:15 ` Randy Dunlap
@ 2008-01-04 22:15 ` Michael Buesch
  2008-01-04 22:34 ` Miguel Botón
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Buesch @ 2008-01-04 22:15 UTC (permalink / raw)
  To: Miguel Botón; +Cc: linux-kernel, linux-wireless, yi.zhu, linville

On Friday 04 January 2008 23:05:54 Miguel Botón wrote:
> This patch fixes a compilation warning in 'iwl-4965.c'.
> 
> Signed-off-by: Miguel Botón <mboton@gmail.com>
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
> index 74999af..92237cd 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
> @@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_priv *priv,
>  	if (skb_headroom(skb) < sizeof(*iwl4965_rt)) {
>  		if (net_ratelimit())
>  			printk(KERN_ERR "not enough headroom [%d] for "
> -			       "radiotap head [%d]\n",
> +			       "radiotap head [%ld]\n",
>  			       skb_headroom(skb), sizeof(*iwl4965_rt));

I think %zu is the correct and portable integer conversion for a size_t type.
The kernel implementation seems to support it.

-- 
Greetings Michael.

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

* Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
  2008-01-04 22:13 ` Roland Dreier
@ 2008-01-04 22:31   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2008-01-04 22:31 UTC (permalink / raw)
  To: rdreier; +Cc: mboton.lkml, linux-kernel, linux-wireless, yi.zhu, linville

From: Roland Dreier <rdreier@cisco.com>
Date: Fri, 04 Jan 2008 14:13:12 -0800

>  > -			       "radiotap head [%d]\n",
>  > +			       "radiotap head [%ld]\n",
>  >  			       skb_headroom(skb), sizeof(*iwl4965_rt));
> 
> Actually I think the correct printf format for printing a size_t
> (coming here from sizeof foo) is "%zd".  Otherwise you'll fix the
> warning on 64-bit targets but add a new warning on 32-bit targets.

Right.

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

* Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
  2008-01-04 22:05 [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c' Miguel Botón
                   ` (2 preceding siblings ...)
  2008-01-04 22:15 ` Michael Buesch
@ 2008-01-04 22:34 ` Miguel Botón
  3 siblings, 0 replies; 6+ messages in thread
From: Miguel Botón @ 2008-01-04 22:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-wireless, yi.zhu, linville

Ok, there's a new patch.

This patch fixes a compilation warning in 'iwl-4965.c'.

"warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’"

Signed-off-by: Miguel Botón <mboton@gmail.com

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 74999af..92237cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_priv *priv,
 	if (skb_headroom(skb) < sizeof(*iwl4965_rt)) {
 		if (net_ratelimit())
 			printk(KERN_ERR "not enough headroom [%d] for "
-			       "radiotap head [%d]\n",
+			       "radiotap head [%zd]\n",
 			       skb_headroom(skb), sizeof(*iwl4965_rt));
 		return;
 	}

-- 
	Miguel Botón

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

end of thread, other threads:[~2008-01-04 22:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-04 22:05 [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c' Miguel Botón
2008-01-04 22:13 ` Roland Dreier
2008-01-04 22:31   ` David Miller
2008-01-04 22:15 ` Randy Dunlap
2008-01-04 22:15 ` Michael Buesch
2008-01-04 22:34 ` Miguel Botón

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox