2008-04-23 20:10:32

by Roel Kluin

[permalink] [raw]
Subject: [PATCH] wireless: rndis_wlan: modparam_workaround_interval is never below 0.

priv->param_workaround_interval is unsigned, modparam_workaround_interval not.
the former is never < 0.

Signed-off-by: Roel Kluin <[email protected]>
---
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 977751f..d0b1fb1 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2402,7 +2402,6 @@ static int bcm4320_early_init(struct usbnet *dev)
priv->param_power_output = modparam_power_output;
priv->param_roamtrigger = modparam_roamtrigger;
priv->param_roamdelta = modparam_roamdelta;
- priv->param_workaround_interval = modparam_workaround_interval;

priv->param_country[0] = toupper(priv->param_country[0]);
priv->param_country[1] = toupper(priv->param_country[1]);
@@ -2425,8 +2424,10 @@ static int bcm4320_early_init(struct usbnet *dev)
else if (priv->param_roamdelta > 2)
priv->param_roamdelta = 2;

- if (priv->param_workaround_interval < 0)
+ if (modparam_workaround_interval < 0)
priv->param_workaround_interval = 500;
+ else
+ priv->param_workaround_interval = modparam_workaround_interval;

rndis_set_config_parameter_str(dev, "Country", priv->param_country);
rndis_set_config_parameter_str(dev, "FrameBursting",


2008-04-24 12:59:35

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] wireless: rndis_wlan: modparam_workaround_interval is never below 0.

On Thu, Apr 24, 2008 at 12:26:28PM +0300, Jussi Kivilinna wrote:
> Quoting Johannes Berg <[email protected]>:
>
>>
>> Eh, why not make the modparam unsigned and default to 500?
>>
>> johannes
>>
>
> Now that I stop and think about it, that would be better option. The
> modparam already has default value of 500.
>
> Reason why workaround modparam is signed, is that value -1 did have some
> functionality in some early version. That then changed and
> priv->param_workaround_interval changed to unsigned and forgot about
> modparam.

I merged the patch, so if you want that behavior we need a new patch.

John
--
John W. Linville
[email protected]

2008-04-24 09:26:30

by Jussi Kivilinna

[permalink] [raw]
Subject: Re: [PATCH] wireless: rndis_wlan: modparam_workaround_interval is never below 0.

Quoting Johannes Berg <[email protected]>:

>
> Eh, why not make the modparam unsigned and default to 500?
>
> johannes
>

Now that I stop and think about it, that would be better option. The
modparam already has default value of 500.

Reason why workaround modparam is signed, is that value -1 did have
some functionality in some early version. That then changed and
priv->param_workaround_interval changed to unsigned and forgot about
modparam.

- Jussi Kivilinna



2008-04-24 06:16:34

by Jussi Kivilinna

[permalink] [raw]
Subject: Re: [PATCH] wireless: rndis_wlan: modparam_workaround_interval is never below 0.

Quoting Roel Kluin <[email protected]>:

> priv->param_workaround_interval is unsigned,
> modparam_workaround_interval not.
> the former is never < 0.
>
> Signed-off-by: Roel Kluin <[email protected]>

Thanks.

Acked-by: Jussi Kivilinna <[email protected]>

> ---
> diff --git a/drivers/net/wireless/rndis_wlan.c
> b/drivers/net/wireless/rndis_wlan.c
> index 977751f..d0b1fb1 100644
> --- a/drivers/net/wireless/rndis_wlan.c
> +++ b/drivers/net/wireless/rndis_wlan.c
> @@ -2402,7 +2402,6 @@ static int bcm4320_early_init(struct usbnet *dev)
> priv->param_power_output = modparam_power_output;
> priv->param_roamtrigger = modparam_roamtrigger;
> priv->param_roamdelta = modparam_roamdelta;
> - priv->param_workaround_interval = modparam_workaround_interval;
>
> priv->param_country[0] = toupper(priv->param_country[0]);
> priv->param_country[1] = toupper(priv->param_country[1]);
> @@ -2425,8 +2424,10 @@ static int bcm4320_early_init(struct usbnet *dev)
> else if (priv->param_roamdelta > 2)
> priv->param_roamdelta = 2;
>
> - if (priv->param_workaround_interval < 0)
> + if (modparam_workaround_interval < 0)
> priv->param_workaround_interval = 500;
> + else
> + priv->param_workaround_interval = modparam_workaround_interval;
>
> rndis_set_config_parameter_str(dev, "Country", priv->param_country);
> rndis_set_config_parameter_str(dev, "FrameBursting",
>
>





2008-04-24 08:57:39

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] wireless: rndis_wlan: modparam_workaround_interval is never below 0.

On Wed, 2008-04-23 at 22:10 +0200, Roel Kluin wrote:
> priv->param_workaround_interval is unsigned,
> modparam_workaround_interval not.
> the former is never < 0.

> - priv->param_workaround_interval = modparam_workaround_interval;
>
> - if (priv->param_workaround_interval < 0)
> + if (modparam_workaround_interval < 0)
> priv->param_workaround_interval = 500;
> + else
> + priv->param_workaround_interval = modparam_workaround_interval;

Eh, why not make the modparam unsigned and default to 500?

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part