staging: wilc1000: use is_zero_ether_addr() API to check mac address
authorAjay Singh <ajay.kathat@microchip.com>
Sun, 2 Dec 2018 18:02:43 +0000 (18:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 08:48:46 +0000 (09:48 +0100)
Use is_zero_ether_addr() API to check if mac address value is zero.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/linux_wlan.c

index 8ce56a38649edf4dd02e131be0fea38e2b174399..310138d82d5f869875b1e11f4802fe01fccc4c0b 100644 (file)
@@ -3400,13 +3400,12 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN])
        struct wid wid;
        int result;
        int i;
-       u8 zero_addr[ETH_ALEN] = {0};
        u8 assoc_sta = 0;
        struct del_all_sta del_sta;
 
        memset(&del_sta, 0x0, sizeof(del_sta));
        for (i = 0; i < WILC_MAX_NUM_STA; i++) {
-               if (memcmp(mac_addr[i], zero_addr, ETH_ALEN)) {
+               if (!is_zero_ether_addr(mac_addr[i])) {
                        assoc_sta++;
                        ether_addr_copy(del_sta.mac[i], mac_addr[i]);
                }
index e246d18896e4f19496d6e9ef38aa151dee71d74b..142816a911f387dbccd961186d0c8ddd921d4971 100644 (file)
@@ -205,11 +205,10 @@ void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode)
 int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc)
 {
        u8 i = 0;
-       u8 null_bssid[6] = {0};
        u8 ret_val = 0;
 
        for (i = 0; i < wilc->vif_num; i++)
-               if (memcmp(wilc->vif[i]->bssid, null_bssid, 6))
+               if (!is_zero_ether_addr(wilc->vif[i]->bssid))
                        ret_val++;
 
        return ret_val;