Commit 7aa48d37 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Greg Kroah-Hartman

staging: wilc1000: Remove useless function

GCC warns that 'wid' is unused in wilc_remove_key and it's correct; the
variable is only local. Get rid of the function (since it just returns
zero) and shuffle the remaining code into one if statement.
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 17521b1a
...@@ -2606,18 +2606,6 @@ static void timer_connect_cb(struct timer_list *t) ...@@ -2606,18 +2606,6 @@ static void timer_connect_cb(struct timer_list *t)
wilc_enqueue_cmd(&msg); wilc_enqueue_cmd(&msg);
} }
s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *sta_addr)
{
struct wid wid;
wid.id = (u16)WID_REMOVE_KEY;
wid.type = WID_STR;
wid.val = (s8 *)sta_addr;
wid.size = 6;
return 0;
}
int wilc_remove_wep_key(struct wilc_vif *vif, u8 index) int wilc_remove_wep_key(struct wilc_vif *vif, u8 index)
{ {
int result = 0; int result = 0;
......
...@@ -303,7 +303,6 @@ struct add_sta_param { ...@@ -303,7 +303,6 @@ struct add_sta_param {
}; };
struct wilc_vif; struct wilc_vif;
s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *sta_addr);
int wilc_remove_wep_key(struct wilc_vif *vif, u8 index); int wilc_remove_wep_key(struct wilc_vif *vif, u8 index);
int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index); int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index);
int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len,
......
...@@ -1054,15 +1054,11 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -1054,15 +1054,11 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
} }
} }
if (key_index >= 0 && key_index <= 3) { if (key_index >= 0 && key_index <= 3 && priv->wep_key_len[key_index]) {
if (priv->wep_key_len[key_index]) { memset(priv->wep_key[key_index], 0,
memset(priv->wep_key[key_index], 0, priv->wep_key_len[key_index]);
priv->wep_key_len[key_index]); priv->wep_key_len[key_index] = 0;
priv->wep_key_len[key_index] = 0; wilc_remove_wep_key(vif, key_index);
wilc_remove_wep_key(vif, key_index);
}
} else {
wilc_remove_key(priv->hif_drv, mac_addr);
} }
return 0; return 0;
......
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