wireless: rndis_wlan: modparam_workaround_interval is never below 0.
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
@@ -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",
Quoting Roel Kluin <[email protected]>:
Quoted 5 lines
priv->param_workaround_intervalis unsigned,modparam_workaround_intervalnot.
the former is never < 0.Signed-off-by Roel Kluin <[email protected]>
Thanks.
Quoted 28 lines
---
drivers/net/wireless/rndis_wlan.c +3
-2@@ -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",
Johannes Berg
maintainerdrivers/net/wireless/rndis_wlan.c static int bcm4320_early_init(struct usbnet *dev) · line 2430
Quoted 11 lines · Roel Kluin
priv->param_workaround_intervalis unsigned,modparam_workaround_intervalnot.
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
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
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_intervalchanged 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]