staging: r8188eu: use is_*_ether_addr() in rtw_macaddr_cfg()
authorMichael Straube <straube.linux@gmail.com>
Mon, 30 Aug 2021 12:15:04 +0000 (14:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Sep 2021 06:49:45 +0000 (08:49 +0200)
Use is_broadcast_ether_addr() and is_zero_ether_addr() in
rtw_macaddr_cfg(). The buffer is properly aligned.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210830121508.6411-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_ieee80211.c

index 205798b76cf990ef0f86aa4c901f50fb0ebc32c0..35a548e1c92e09d42d0eaecef0d7654593407a23 100644 (file)
@@ -1032,10 +1032,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
                memcpy(mac, mac_addr, ETH_ALEN);
        }
 
-       if (((mac[0] == 0xff) && (mac[1] == 0xff) && (mac[2] == 0xff) &&
-            (mac[3] == 0xff) && (mac[4] == 0xff) && (mac[5] == 0xff)) ||
-           ((mac[0] == 0x0) && (mac[1] == 0x0) && (mac[2] == 0x0) &&
-            (mac[3] == 0x0) && (mac[4] == 0x0) && (mac[5] == 0x0))) {
+       if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
                mac[0] = 0x00;
                mac[1] = 0xe0;
                mac[2] = 0x4c;