Skip to contentSkip to conversation

wireless: rndis_wlan: modparam_workaround_interval is never below 0.

PATCH In review Roel Kluin 4 participants 5 messages Apr 23, 2008 – Apr 24, 2008 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 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.

---

drivers/net/wireless/rndis_wlan.c +3 -2
index 977751f..d0b1fb1 100644
@@ -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",
Acked-by on v1 1/1
#1 lore raw

Quoting Roel Kluin <[email protected]>:

Quoted 5 lines

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

Thanks.

Quoted 28 lines

---

drivers/net/wireless/rndis_wlan.c +3 -2
index 977751f..d0b1fb1 100644
@@ -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",
maintainer
#2 lore raw
In reply to Roel Kluin

drivers/net/wireless/rndis_wlan.c static int bcm4320_early_init(struct usbnet *dev) · line 2430

Quoted 11 lines · Roel Kluin

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

drivers/net/wireless/rndis_wlan.c +3 -2
-	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

#3 lore raw

Quoting Johannes Berg <[email protected]>:

Quoted 5 lines

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

#4 lore raw
Quoted 8 lines · Jussi Kivilinna

Quoting Johannes Berg <[email protected]>:

Quoted 5 lines

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

johannes

Quoted 7 lines

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

Signature · 2 lines
John W. Linville
[email protected]