2008-01-04 22:05:57

by Miguel Botón

[permalink] [raw]
Subject: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'

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

Signed-off-by: Miguel Bot=C3=B3n <[email protected]>

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wire=
less/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_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


2008-01-04 22:31:20

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'

From: Roland Dreier <[email protected]>
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.

2008-01-04 22:18:09

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'

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

> Signed-off-by: Miguel Bot=F3n <[email protected]>
>=20
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wi=
reless/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/

2008-01-04 22:13:14

by Roland Dreier

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'

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

2008-01-04 22:34:37

by Miguel Botón

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'

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"

Signed-off-by: Miguel Bot=C3=B3n <[email protected]

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wire=
less/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_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

2008-01-04 22:16:40

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'

On Friday 04 January 2008 23:05:54 Miguel Bot=C3=B3n wrote:
> This patch fixes a compilation warning in 'iwl-4965.c'.
>=20
> Signed-off-by: Miguel Bot=C3=B3n <[email protected]>
>=20
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wi=
reless/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.

--=20
Greetings Michael.