staging: wilc1000: replaces memcmp with ether_addr_equal_unaligned
authorLeo Kim <leo.kim@atmel.com>
Fri, 25 Mar 2016 12:16:53 +0000 (21:16 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
This patch replaces memcmp with ether_addr_equal_unaligned.
Warning reported by checkpatch.pl
 - Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c

index db624ef31e6986c318024651e4f1a601b7fb58dc..8f0a74d3ff86710e1b27e6cba16338825d1529da 100644 (file)
@@ -259,10 +259,12 @@ static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
 
        for (i = 0; i < wilc->vif_num; i++) {
                if (wilc->vif[i]->mode == STATION_MODE)
-                       if (!memcmp(bssid, wilc->vif[i]->bssid, ETH_ALEN))
+                       if (ether_addr_equal_unaligned(bssid,
+                                                      wilc->vif[i]->bssid))
                                return wilc->vif[i]->ndev;
                if (wilc->vif[i]->mode == AP_MODE)
-                       if (!memcmp(bssid1, wilc->vif[i]->bssid, ETH_ALEN))
+                       if (ether_addr_equal_unaligned(bssid1,
+                                                      wilc->vif[i]->bssid))
                                return wilc->vif[i]->ndev;
        }