]> www.infradead.org Git - users/willy/linux.git/commitdiff
staging: r8188eu: replace custom macros with is_broadcast_ether_addr
authorMichael Straube <straube.linux@gmail.com>
Thu, 5 Aug 2021 20:50:10 +0000 (22:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Aug 2021 04:37:20 +0000 (06:37 +0200)
Replace usage of custom macros with is_broadcast_ether_addr. All buffers
are properly aligned. Remove the now unsued macros MacAddr_isBcst and
IS_MAC_ADDRESS_BROADCAST.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210805205010.31192-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_ioctl_set.c
drivers/staging/r8188eu/core/rtw_recv.c
drivers/staging/r8188eu/include/wifi.h

index a7f966ad7082736b29e154a94798bb2bbb923bbf..1a4227729e0ddf759a837b4243c41c2acff9b6ad 100644 (file)
 
 extern void indicate_wx_scan_complete_event(struct adapter *padapter);
 
-#define IS_MAC_ADDRESS_BROADCAST(addr) \
-(\
-       ((addr[0] == 0xff) && (addr[1] == 0xff) && \
-               (addr[2] == 0xff) && (addr[3] == 0xff) && \
-               (addr[4] == 0xff) && (addr[5] == 0xff))  ? true : false \
-)
-
 u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid)
 {
        u8       i;
@@ -540,7 +533,7 @@ u8 rtw_set_802_11_add_key(struct adapter *padapter, struct ndis_802_11_key *key)
                }
 
                /*  check BSSID */
-               if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true) {
+               if (is_broadcast_ether_addr(key->BSSID)) {
                        ret = false;
                        goto exit;
                }
@@ -592,7 +585,7 @@ u8 rtw_set_802_11_add_key(struct adapter *padapter, struct ndis_802_11_key *key)
                        encryptionalgo = padapter->securitypriv.dot118021XGrpPrivacy;
                }
 
-               if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) == true) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == false)) {
+               if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) && !is_broadcast_ether_addr(key->BSSID)) {
                        ret = _FAIL;
                        goto exit;
                }
index 46fb8c28965262ece40a919986c3c85206cc6cf5..3f5a7282c8573a3c67a0e58305a772b4f6986f2a 100644 (file)
@@ -622,7 +622,7 @@ static void count_rx_stats(struct adapter *padapter, struct recv_frame *prframe,
 
        padapter->mlmepriv.LinkDetectInfo.NumRxOkInPeriod++;
 
-       if ((!MacAddr_isBcst(pattrib->dst)) && (!IS_MCAST(pattrib->dst)))
+       if (!is_broadcast_ether_addr(pattrib->dst) && !IS_MCAST(pattrib->dst))
                padapter->mlmepriv.LinkDetectInfo.NumRxUnicastOkInPeriod++;
 
        if (sta)
index 2c56d1d70d0369062ef9797730b801eaf8941cfd..65fc677bf4ebefc52a55489cb4b5c8471678bbc5 100644 (file)
@@ -368,13 +368,6 @@ enum WIFI_REG_DOMAIN {
 
 #define GetAddr4Ptr(pbuf)      ((unsigned char *)((size_t)(pbuf) + 24))
 
-#define MacAddr_isBcst(addr) \
-       ( \
-       ((addr[0] == 0xff) && (addr[1] == 0xff) && \
-       (addr[2] == 0xff) && (addr[3] == 0xff) && \
-       (addr[4] == 0xff) && (addr[5] == 0xff))  ? true : false \
-)
-
 static inline int IS_MCAST(unsigned char *da)
 {
        if ((*da) & 0x01)