staging: wilc1000: Remove unnecessary array index check
authorNathan Chancellor <natechancellor@gmail.com>
Sun, 6 May 2018 07:33:33 +0000 (00:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 May 2018 02:11:23 +0000 (19:11 -0700)
This statment triggers GCC's -Wtype-limit since key_index is an
unsigned integer so it cannot be less than zero.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index b499fb987395e8c53ede15b1d3a9aa3698cf6dfd..e0015ca6c21a41080667181456f3083b2744ebae 100644 (file)
@@ -1054,7 +1054,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
                }
        }
 
-       if (key_index >= 0 && key_index <= 3 && priv->wep_key_len[key_index]) {
+       if (key_index <= 3 && priv->wep_key_len[key_index]) {
                memset(priv->wep_key[key_index], 0,
                       priv->wep_key_len[key_index]);
                priv->wep_key_len[key_index] = 0;