diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2019-06-26 12:40:58 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-01 09:01:41 +0200 |
commit | 264a472d29b8843c979a361abcf2f324bcb045cf (patch) | |
tree | f807ad908c012b1b38f1f0c9e586bb99ba69b876 /drivers/staging/wilc1000/wilc_netdev.c | |
parent | 2f5e568b28fb72f0e88c6876308072242d3f4d16 (diff) |
staging: wilc1000: remove unnecessary loop to traverse vif interfaces
Cleanup patch to avoid loop to traverse the interfaces instead make use
of vif received from net_device priv data.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_netdev.c')
-rw-r--r-- | drivers/staging/wilc1000/wilc_netdev.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c index ad04744c4e4f..0af60b2f9f6d 100644 --- a/drivers/staging/wilc1000/wilc_netdev.c +++ b/drivers/staging/wilc1000/wilc_netdev.c @@ -614,7 +614,6 @@ static int wilc_mac_open(struct net_device *ndev) struct wilc_priv *priv = wdev_priv(vif->ndev->ieee80211_ptr); unsigned char mac_add[ETH_ALEN] = {0}; int ret = 0; - int i = 0; if (!wl || !wl->dev) { netdev_err(ndev, "device not ready\n"); @@ -633,19 +632,14 @@ static int wilc_mac_open(struct net_device *ndev) return ret; } - for (i = 0; i < wl->vif_num; i++) { - if (ndev == wl->vif[i]->ndev) { - wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), - vif->iftype, vif->idx); - wilc_set_operation_mode(vif, vif->iftype); - break; - } - } + wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), vif->iftype, + vif->idx); + wilc_set_operation_mode(vif, vif->iftype); wilc_get_mac_address(vif, mac_add); netdev_dbg(ndev, "Mac address: %pM\n", mac_add); - memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN); - memcpy(ndev->dev_addr, wl->vif[i]->src_addr, ETH_ALEN); + memcpy(vif->src_addr, mac_add, ETH_ALEN); + memcpy(ndev->dev_addr, vif->src_addr, ETH_ALEN); if (!is_valid_ether_addr(ndev->dev_addr)) { netdev_err(ndev, "Wrong MAC address\n"); |