diff options
author | Vivek Natarajan <nataraja@qca.qualcomm.com> | 2011-12-29 05:48:39 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-01-02 11:38:32 -0500 |
commit | 792ecb33080f4e315695e0fe21cf3a3c2a514dd0 (patch) | |
tree | 5cd06449c7fd2471905fc5c53aa3924a4663b8a8 /drivers/net/wireless/ath | |
parent | a10e2f2f6db8f86eaca1cf3d00269463da4d6434 (diff) |
ath6kl: Remove redundant key_index check.
Less-than-zero comparison of an unsigned value is never true.
kvalo: remove WMI_MIN_KEY_INDEX altogether, it's useless
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.h | 1 |
3 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index c756425abf73..2a166cc7cc3c 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -524,8 +524,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
524 | (vif->prwise_crypto == WEP_CRYPT)) { | 524 | (vif->prwise_crypto == WEP_CRYPT)) { |
525 | struct ath6kl_key *key = NULL; | 525 | struct ath6kl_key *key = NULL; |
526 | 526 | ||
527 | if (sme->key_idx < WMI_MIN_KEY_INDEX || | 527 | if (sme->key_idx > WMI_MAX_KEY_INDEX) { |
528 | sme->key_idx > WMI_MAX_KEY_INDEX) { | ||
529 | ath6kl_err("key index %d out of bounds\n", | 528 | ath6kl_err("key index %d out of bounds\n", |
530 | sme->key_idx); | 529 | sme->key_idx); |
531 | up(&ar->sem); | 530 | up(&ar->sem); |
@@ -997,7 +996,7 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
997 | params->key); | 996 | params->key); |
998 | } | 997 | } |
999 | 998 | ||
1000 | if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { | 999 | if (key_index > WMI_MAX_KEY_INDEX) { |
1001 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, | 1000 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, |
1002 | "%s: key index %d out of bounds\n", __func__, | 1001 | "%s: key index %d out of bounds\n", __func__, |
1003 | key_index); | 1002 | key_index); |
@@ -1115,7 +1114,7 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1115 | if (!ath6kl_cfg80211_ready(vif)) | 1114 | if (!ath6kl_cfg80211_ready(vif)) |
1116 | return -EIO; | 1115 | return -EIO; |
1117 | 1116 | ||
1118 | if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { | 1117 | if (key_index > WMI_MAX_KEY_INDEX) { |
1119 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, | 1118 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, |
1120 | "%s: key index %d out of bounds\n", __func__, | 1119 | "%s: key index %d out of bounds\n", __func__, |
1121 | key_index); | 1120 | key_index); |
@@ -1148,7 +1147,7 @@ static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1148 | if (!ath6kl_cfg80211_ready(vif)) | 1147 | if (!ath6kl_cfg80211_ready(vif)) |
1149 | return -EIO; | 1148 | return -EIO; |
1150 | 1149 | ||
1151 | if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { | 1150 | if (key_index > WMI_MAX_KEY_INDEX) { |
1152 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, | 1151 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, |
1153 | "%s: key index %d out of bounds\n", __func__, | 1152 | "%s: key index %d out of bounds\n", __func__, |
1154 | key_index); | 1153 | key_index); |
@@ -1184,7 +1183,7 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy, | |||
1184 | if (!ath6kl_cfg80211_ready(vif)) | 1183 | if (!ath6kl_cfg80211_ready(vif)) |
1185 | return -EIO; | 1184 | return -EIO; |
1186 | 1185 | ||
1187 | if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { | 1186 | if (key_index > WMI_MAX_KEY_INDEX) { |
1188 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, | 1187 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, |
1189 | "%s: key index %d out of bounds\n", | 1188 | "%s: key index %d out of bounds\n", |
1190 | __func__, key_index); | 1189 | __func__, key_index); |
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index f3d0184a5cea..f74986d62098 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c | |||
@@ -363,7 +363,7 @@ static void ath6kl_install_static_wep_keys(struct ath6kl_vif *vif) | |||
363 | u8 index; | 363 | u8 index; |
364 | u8 keyusage; | 364 | u8 keyusage; |
365 | 365 | ||
366 | for (index = WMI_MIN_KEY_INDEX; index <= WMI_MAX_KEY_INDEX; index++) { | 366 | for (index = 0; index <= WMI_MAX_KEY_INDEX; index++) { |
367 | if (vif->wep_key_list[index].key_len) { | 367 | if (vif->wep_key_list[index].key_len) { |
368 | keyusage = GROUP_USAGE; | 368 | keyusage = GROUP_USAGE; |
369 | if (index == vif->def_txkey_index) | 369 | if (index == vif->def_txkey_index) |
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index 9f8425b97db7..2b435994b013 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h | |||
@@ -649,7 +649,6 @@ enum auth_mode { | |||
649 | WPA2_AUTH_CCKM = 0x40, | 649 | WPA2_AUTH_CCKM = 0x40, |
650 | }; | 650 | }; |
651 | 651 | ||
652 | #define WMI_MIN_KEY_INDEX 0 | ||
653 | #define WMI_MAX_KEY_INDEX 3 | 652 | #define WMI_MAX_KEY_INDEX 3 |
654 | 653 | ||
655 | #define WMI_MAX_KEY_LEN 32 | 654 | #define WMI_MAX_KEY_LEN 32 |