Skip to contentSkip to conversation

iwlwifi: fix compilation warning in 'iwl-4965.c'

PATCH In review Miguel Botón 5 participants 6 messages Jan 4, 2008

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

PATCH 1/1 iwlwifi: fix compilation warning in 'iwl-4965.c'

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

drivers/net/wire= renamed from drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0

less/iwlwifi/iwl-4965.c
index 74999af..92237cd 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0
@@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_p=

riv *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;
}

--=20
Miguel Bot=C3=B3n
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

Review

Quoted 3 lines
(quoted diff) +1 -1
-			       "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.

maintainer
#2 lore raw

From: Roland Dreier <[email protected]>
Date: Fri, 04 Jan 2008 14:13:12 -0800

Quoted 7 lines

Review

Quoted 3 lines
(quoted diff) +1 -1
-			       "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.

#3 lore raw
In reply to Miguel Botón

drivers/net/wi=

Quoted 5 lines · On Friday 04 January 2008 23:05:54 Miguel Bot=C3=B3n wrote:

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

=20

drivers/net/wi= renamed from drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0

reless/iwlwifi/iwl-4965.c

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_add_radiotap(struct iwl4965=

Quoted 4 lines

index 74999af..92237cd 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0
@@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965=

_priv *priv,

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_add_radiotap(struct iwl4965= · line 3620

Quoted 6 lines
drivers/net/wireless/iwlwifi/iwl-4965.c +1 -1
 	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.

--=20
Greetings Michael.
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Miguel Botón
Quoted 1 line · On Fri, 4 Jan 2008 23:05:54 +0100 Miguel Bot=F3n wrote:

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

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

drivers/net/wi=

Quoted 3 lines

=20

drivers/net/wi= renamed from drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0

reless/iwlwifi/iwl-4965.c

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_add_radiotap(struct iwl4965=

Quoted 4 lines

index 74999af..92237cd 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0
@@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965=

_priv *priv,

drivers/net/wireless/iwlwifi/iwl-4965.c static void iwl4965_add_radiotap(struct iwl4965= · line 3622

Quoted 8 lines
drivers/net/wireless/iwlwifi/iwl-4965.c +1 -1
 	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/
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Miguel Botón

Ok, there's a new patch.

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

"warning: format =E2=80=98%d=E2=80=99 expects type =E2=80=98int=E2=80=99= , but argument 3 has type =E2=80=98long unsigned int=E2=80=99"

drivers/net/wire= renamed from drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0

less/iwlwifi/iwl-4965.c
index 74999af..92237cd 100644

drivers/net/wireless/iwlwifi/iwl-4965.c +0 -0
@@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_p=

riv *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;
}

--=20
Miguel Bot=C3=B3n
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html