diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2018-05-06 15:03:00 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-08 13:44:56 +0200 |
commit | 6d6612deaf559c42ab4df207e3842aa92a5af71d (patch) | |
tree | fa487821e3daa64b491a541abe68dedcf7e53646 | |
parent | be8a8ca34b94352afeac5c449422c68d6a35942b (diff) | |
download | linux-6d6612deaf559c42ab4df207e3842aa92a5af71d.tar.bz2 |
staging: ks7010: Remove unnecessary limit checks
uwrq is an unsigned 32-bit integer, it cannot be less than zero.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/ks7010/ks_wlan_net.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index ee164ab571a9..6d5ac6258d99 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -1920,7 +1920,7 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev, if (priv->sleep_mode == SLP_SLEEP) return -EPERM; /* for SLEEP MODE */ - if (*uwrq < BEACON_LOST_COUNT_MIN || *uwrq > BEACON_LOST_COUNT_MAX) + if (*uwrq > BEACON_LOST_COUNT_MAX) return -EINVAL; priv->reg.beacon_lost_count = *uwrq; @@ -2120,7 +2120,7 @@ static int ks_wlan_set_tx_gain(struct net_device *dev, if (priv->sleep_mode == SLP_SLEEP) return -EPERM; /* for SLEEP MODE */ - if (*uwrq < 0 || *uwrq > 0xFF) + if (*uwrq > 0xFF) return -EINVAL; priv->gain.tx_gain = (uint8_t)*uwrq; @@ -2152,7 +2152,7 @@ static int ks_wlan_set_rx_gain(struct net_device *dev, if (priv->sleep_mode == SLP_SLEEP) return -EPERM; /* for SLEEP MODE */ - if (*uwrq < 0 || *uwrq > 0xFF) + if (*uwrq > 0xFF) return -EINVAL; priv->gain.rx_gain = (uint8_t)*uwrq; |