Commit 6d6612de authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Greg Kroah-Hartman

staging: ks7010: Remove unnecessary limit checks

uwrq is an unsigned 32-bit integer, it cannot be less than zero.
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be8a8ca3
...@@ -1920,7 +1920,7 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev, ...@@ -1920,7 +1920,7 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev,
if (priv->sleep_mode == SLP_SLEEP) if (priv->sleep_mode == SLP_SLEEP)
return -EPERM; return -EPERM;
/* for SLEEP MODE */ /* for SLEEP MODE */
if (*uwrq < BEACON_LOST_COUNT_MIN || *uwrq > BEACON_LOST_COUNT_MAX) if (*uwrq > BEACON_LOST_COUNT_MAX)
return -EINVAL; return -EINVAL;
priv->reg.beacon_lost_count = *uwrq; priv->reg.beacon_lost_count = *uwrq;
...@@ -2120,7 +2120,7 @@ static int ks_wlan_set_tx_gain(struct net_device *dev, ...@@ -2120,7 +2120,7 @@ static int ks_wlan_set_tx_gain(struct net_device *dev,
if (priv->sleep_mode == SLP_SLEEP) if (priv->sleep_mode == SLP_SLEEP)
return -EPERM; return -EPERM;
/* for SLEEP MODE */ /* for SLEEP MODE */
if (*uwrq < 0 || *uwrq > 0xFF) if (*uwrq > 0xFF)
return -EINVAL; return -EINVAL;
priv->gain.tx_gain = (uint8_t)*uwrq; priv->gain.tx_gain = (uint8_t)*uwrq;
...@@ -2152,7 +2152,7 @@ static int ks_wlan_set_rx_gain(struct net_device *dev, ...@@ -2152,7 +2152,7 @@ static int ks_wlan_set_rx_gain(struct net_device *dev,
if (priv->sleep_mode == SLP_SLEEP) if (priv->sleep_mode == SLP_SLEEP)
return -EPERM; return -EPERM;
/* for SLEEP MODE */ /* for SLEEP MODE */
if (*uwrq < 0 || *uwrq > 0xFF) if (*uwrq > 0xFF)
return -EINVAL; return -EINVAL;
priv->gain.rx_gain = (uint8_t)*uwrq; priv->gain.rx_gain = (uint8_t)*uwrq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment