Commit 44dc9c86 authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: ks7010: remove unnecessary else statement

Checkpatch emits WARNING: else is not generally useful after a break
or return. Two warnings of this type are emitted, both are the result
of a else statement after a return statement. The 'else' can safely be
removed.

Remove unnecessary else statement.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7676b724
...@@ -1885,8 +1885,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev, ...@@ -1885,8 +1885,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
/* for SLEEP MODE */ /* for SLEEP MODE */
if (index < 1 || index > 4) if (index < 1 || index > 4)
return -EINVAL; return -EINVAL;
else index--;
index--;
if (dwrq->flags & IW_ENCODE_DISABLED) if (dwrq->flags & IW_ENCODE_DISABLED)
priv->wpa.key[index].key_len = 0; priv->wpa.key[index].key_len = 0;
...@@ -2076,20 +2075,21 @@ static int ks_wlan_set_pmksa(struct net_device *dev, ...@@ -2076,20 +2075,21 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
case IW_PMKSA_REMOVE: case IW_PMKSA_REMOVE:
if (list_empty(&priv->pmklist.head)) { /* list empty */ if (list_empty(&priv->pmklist.head)) { /* list empty */
return -EINVAL; return -EINVAL;
} else { /* search cache data */ }
list_for_each(ptr, &priv->pmklist.head) { /* search cache data */
pmk = list_entry(ptr, struct pmk_t, list); list_for_each(ptr, &priv->pmklist.head) {
if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) { /* match address! list del. */ pmk = list_entry(ptr, struct pmk_t, list);
eth_zero_addr(pmk->bssid); if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) { /* match address! list del. */
memset(pmk->pmkid, 0, IW_PMKID_LEN); eth_zero_addr(pmk->bssid);
list_del_init(&pmk->list); memset(pmk->pmkid, 0, IW_PMKID_LEN);
break; list_del_init(&pmk->list);
} break;
}
if (ptr == &priv->pmklist.head) { /* not find address. */
return 0;
} }
} }
if (ptr == &priv->pmklist.head) { /* not find address. */
return 0;
}
break; break;
case IW_PMKSA_FLUSH: case IW_PMKSA_FLUSH:
memset(&priv->pmklist, 0, sizeof(priv->pmklist)); memset(&priv->pmklist, 0, sizeof(priv->pmklist));
......
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