Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/net: Convert compare_ether_addr to ether_addr_equal

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
- !compare_ether_addr(a, b)
+ ether_addr_equal(a, b)

@@
expression a,b;
@@
- compare_ether_addr(a, b)
+ !ether_addr_equal(a, b)

@@
expression a,b;
@@
- !ether_addr_equal(a, b) == 0
+ ether_addr_equal(a, b)

@@
expression a,b;
@@
- !ether_addr_equal(a, b) != 0
+ !ether_addr_equal(a, b)

@@
expression a,b;
@@
- ether_addr_equal(a, b) == 0
+ !ether_addr_equal(a, b)

@@
expression a,b;
@@
- ether_addr_equal(a, b) != 0
+ ether_addr_equal(a, b)

@@
expression a,b;
@@
- !!ether_addr_equal(a, b)
+ ether_addr_equal(a, b)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
2e42e474 39f1d94d

+85 -86
+1 -1
drivers/net/bonding/bond_main.c
··· 1961 1961 write_lock_bh(&bond->lock); 1962 1962 1963 1963 if (!bond->params.fail_over_mac) { 1964 - if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && 1964 + if (ether_addr_equal(bond_dev->dev_addr, slave->perm_hwaddr) && 1965 1965 bond->slave_cnt > 1) 1966 1966 pr_warning("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s. Set the HWaddr of %s to a different address to avoid conflicts.\n", 1967 1967 bond_dev->name, slave_dev->name,
+2 -1
drivers/net/ethernet/amd/depca.c
··· 1079 1079 } else { 1080 1080 lp->pktStats.multicast++; 1081 1081 } 1082 - } else if (compare_ether_addr(buf, dev->dev_addr) == 0) { 1082 + } else if (ether_addr_equal(buf, 1083 + dev->dev_addr)) { 1083 1084 lp->pktStats.unicast++; 1084 1085 } 1085 1086
+4 -8
drivers/net/ethernet/cisco/enic/enic_main.c
··· 944 944 945 945 for (i = 0; i < enic->mc_count; i++) { 946 946 for (j = 0; j < mc_count; j++) 947 - if (compare_ether_addr(enic->mc_addr[i], 948 - mc_addr[j]) == 0) 947 + if (ether_addr_equal(enic->mc_addr[i], mc_addr[j])) 949 948 break; 950 949 if (j == mc_count) 951 950 enic_dev_del_addr(enic, enic->mc_addr[i]); ··· 952 953 953 954 for (i = 0; i < mc_count; i++) { 954 955 for (j = 0; j < enic->mc_count; j++) 955 - if (compare_ether_addr(mc_addr[i], 956 - enic->mc_addr[j]) == 0) 956 + if (ether_addr_equal(mc_addr[i], enic->mc_addr[j])) 957 957 break; 958 958 if (j == enic->mc_count) 959 959 enic_dev_add_addr(enic, mc_addr[i]); ··· 997 999 998 1000 for (i = 0; i < enic->uc_count; i++) { 999 1001 for (j = 0; j < uc_count; j++) 1000 - if (compare_ether_addr(enic->uc_addr[i], 1001 - uc_addr[j]) == 0) 1002 + if (ether_addr_equal(enic->uc_addr[i], uc_addr[j])) 1002 1003 break; 1003 1004 if (j == uc_count) 1004 1005 enic_dev_del_addr(enic, enic->uc_addr[i]); ··· 1005 1008 1006 1009 for (i = 0; i < uc_count; i++) { 1007 1010 for (j = 0; j < enic->uc_count; j++) 1008 - if (compare_ether_addr(uc_addr[i], 1009 - enic->uc_addr[j]) == 0) 1011 + if (ether_addr_equal(uc_addr[i], enic->uc_addr[j])) 1010 1012 break; 1011 1013 if (j == enic->uc_count) 1012 1014 enic_dev_add_addr(enic, uc_addr[i]);
+2 -1
drivers/net/ethernet/dec/ewrk3.c
··· 1016 1016 } else { 1017 1017 lp->pktStats.multicast++; 1018 1018 } 1019 - } else if (compare_ether_addr(p, dev->dev_addr) == 0) { 1019 + } else if (ether_addr_equal(p, 1020 + dev->dev_addr)) { 1020 1021 lp->pktStats.unicast++; 1021 1022 } 1022 1023 lp->pktStats.bins[0]++; /* Duplicates stats.rx_packets */
+1 -1
drivers/net/ethernet/dec/tulip/de4x5.c
··· 1874 1874 } else { 1875 1875 lp->pktStats.multicast++; 1876 1876 } 1877 - } else if (compare_ether_addr(buf, dev->dev_addr) == 0) { 1877 + } else if (ether_addr_equal(buf, dev->dev_addr)) { 1878 1878 lp->pktStats.unicast++; 1879 1879 } 1880 1880
+2 -3
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
··· 1965 1965 __le16 vlan_id = 0; 1966 1966 u8 hindex; 1967 1967 1968 - if (!compare_ether_addr(phdr->h_source, adapter->mac_addr)) 1968 + if (ether_addr_equal(phdr->h_source, adapter->mac_addr)) 1969 1969 return; 1970 1970 1971 1971 if (adapter->fhash.fnum >= adapter->fhash.fmax) ··· 2235 2235 2236 2236 if (adapter->flags & QLCNIC_MACSPOOF) { 2237 2237 phdr = (struct ethhdr *)skb->data; 2238 - if (compare_ether_addr(phdr->h_source, 2239 - adapter->mac_addr)) 2238 + if (!ether_addr_equal(phdr->h_source, adapter->mac_addr)) 2240 2239 goto drop_packet; 2241 2240 } 2242 2241
+1 -1
drivers/net/ethernet/sfc/ethtool.c
··· 1023 1023 return -EINVAL; 1024 1024 1025 1025 /* Is it a default UC or MC filter? */ 1026 - if (!compare_ether_addr(mac_mask->h_dest, mac_addr_mc_mask) && 1026 + if (ether_addr_equal(mac_mask->h_dest, mac_addr_mc_mask) && 1027 1027 vlan_tag_mask == 0) { 1028 1028 if (is_multicast_ether_addr(mac_entry->h_dest)) 1029 1029 rc = efx_filter_set_mc_def(&spec);
+1 -1
drivers/net/ethernet/sun/sunvnet.c
··· 618 618 struct vnet_port *port; 619 619 620 620 hlist_for_each_entry(port, n, hp, hash) { 621 - if (!compare_ether_addr(port->raddr, skb->data)) 621 + if (ether_addr_equal(port->raddr, skb->data)) 622 622 return port; 623 623 } 624 624 port = NULL;
+1 -1
drivers/net/ethernet/tile/tilepro.c
··· 843 843 if (!is_multicast_ether_addr(buf)) { 844 844 /* Filter packets not for our address. */ 845 845 const u8 *mine = dev->dev_addr; 846 - filter = compare_ether_addr(mine, buf); 846 + filter = !ether_addr_equal(mine, buf); 847 847 } 848 848 } 849 849
+4 -4
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
··· 1590 1590 found = 0; 1591 1591 oldest = NULL; 1592 1592 list_for_each_entry(target, &wl->network_list, list) { 1593 - if (!compare_ether_addr(&target->hwinfo->bssid[2], 1594 - &scan_info->bssid[2])) { 1593 + if (ether_addr_equal(&target->hwinfo->bssid[2], 1594 + &scan_info->bssid[2])) { 1595 1595 found = 1; 1596 1596 pr_debug("%s: same BBS found scanned list\n", 1597 1597 __func__); ··· 1691 1691 1692 1692 /* If bss specified, check it only */ 1693 1693 if (test_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat)) { 1694 - if (!compare_ether_addr(&scan_info->hwinfo->bssid[2], 1695 - wl->bssid)) { 1694 + if (ether_addr_equal(&scan_info->hwinfo->bssid[2], 1695 + wl->bssid)) { 1696 1696 best_bss = scan_info; 1697 1697 pr_debug("%s: bssid matched\n", __func__); 1698 1698 break;
+1 -1
drivers/net/tun.c
··· 313 313 314 314 /* Exact match */ 315 315 for (i = 0; i < filter->count; i++) 316 - if (!compare_ether_addr(eh->h_dest, filter->addr[i])) 316 + if (ether_addr_equal(eh->h_dest, filter->addr[i])) 317 317 return 1; 318 318 319 319 /* Inexact match (multicast only) */
+1 -1
drivers/net/wireless/at76c50x-usb.c
··· 1751 1751 * following workaround is necessary. If the TX frame is an 1752 1752 * authentication frame extract the bssid and send the CMD_JOIN. */ 1753 1753 if (mgmt->frame_control & cpu_to_le16(IEEE80211_STYPE_AUTH)) { 1754 - if (compare_ether_addr(priv->bssid, mgmt->bssid)) { 1754 + if (!ether_addr_equal(priv->bssid, mgmt->bssid)) { 1755 1755 memcpy(priv->bssid, mgmt->bssid, ETH_ALEN); 1756 1756 ieee80211_queue_work(hw, &priv->work_join_bssid); 1757 1757 dev_kfree_skb_any(skb);
+3 -3
drivers/net/wireless/ath/ath5k/base.c
··· 462 462 } 463 463 464 464 if (iter_data->need_set_hw_addr && iter_data->hw_macaddr) 465 - if (compare_ether_addr(iter_data->hw_macaddr, mac) == 0) 465 + if (ether_addr_equal(iter_data->hw_macaddr, mac)) 466 466 iter_data->need_set_hw_addr = false; 467 467 468 468 if (!iter_data->any_assoc) { ··· 1170 1170 1171 1171 if (ieee80211_is_beacon(mgmt->frame_control) && 1172 1172 le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && 1173 - compare_ether_addr(mgmt->bssid, common->curbssid) == 0) { 1173 + ether_addr_equal(mgmt->bssid, common->curbssid)) { 1174 1174 /* 1175 1175 * Received an IBSS beacon with the same BSSID. Hardware *must* 1176 1176 * have updated the local TSF. We have to work around various ··· 1234 1234 1235 1235 /* only beacons from our BSSID */ 1236 1236 if (!ieee80211_is_beacon(mgmt->frame_control) || 1237 - compare_ether_addr(mgmt->bssid, common->curbssid) != 0) 1237 + !ether_addr_equal(mgmt->bssid, common->curbssid)) 1238 1238 return; 1239 1239 1240 1240 ewma_add(&ah->ah_beacon_rssi_avg, rssi);
+1 -1
drivers/net/wireless/ath/ath9k/recv.c
··· 1833 1833 if (ieee80211_is_beacon(hdr->frame_control)) { 1834 1834 RX_STAT_INC(rx_beacons); 1835 1835 if (!is_zero_ether_addr(common->curbssid) && 1836 - !compare_ether_addr(hdr->addr3, common->curbssid)) 1836 + ether_addr_equal(hdr->addr3, common->curbssid)) 1837 1837 rs.is_mybeacon = true; 1838 1838 else 1839 1839 rs.is_mybeacon = false;
+1 -1
drivers/net/wireless/ath/carl9170/rx.c
··· 538 538 return; 539 539 540 540 /* and only beacons from the associated BSSID, please */ 541 - if (compare_ether_addr(hdr->addr3, ar->common.curbssid) || 541 + if (!ether_addr_equal(hdr->addr3, ar->common.curbssid) || 542 542 !ar->common.curaid) 543 543 return; 544 544
+8 -8
drivers/net/wireless/ipw2x00/libipw_rx.c
··· 77 77 78 78 if (entry->skb != NULL && entry->seq == seq && 79 79 (entry->last_frag + 1 == frag || frag == -1) && 80 - !compare_ether_addr(entry->src_addr, src) && 81 - !compare_ether_addr(entry->dst_addr, dst)) 80 + ether_addr_equal(entry->src_addr, src) && 81 + ether_addr_equal(entry->dst_addr, dst)) 82 82 return entry; 83 83 } 84 84 ··· 245 245 /* check that the frame is unicast frame to us */ 246 246 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 247 247 IEEE80211_FCTL_TODS && 248 - !compare_ether_addr(hdr->addr1, dev->dev_addr) && 249 - !compare_ether_addr(hdr->addr3, dev->dev_addr)) { 248 + ether_addr_equal(hdr->addr1, dev->dev_addr) && 249 + ether_addr_equal(hdr->addr3, dev->dev_addr)) { 250 250 /* ToDS frame with own addr BSSID and DA */ 251 251 } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 252 252 IEEE80211_FCTL_FROMDS && 253 - !compare_ether_addr(hdr->addr1, dev->dev_addr)) { 253 + ether_addr_equal(hdr->addr1, dev->dev_addr)) { 254 254 /* FromDS frame with own addr as DA */ 255 255 } else 256 256 return 0; ··· 523 523 524 524 if (ieee->iw_mode == IW_MODE_MASTER && !wds && 525 525 (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 526 - IEEE80211_FCTL_FROMDS && ieee->stadev 527 - && !compare_ether_addr(hdr->addr2, ieee->assoc_ap_addr)) { 526 + IEEE80211_FCTL_FROMDS && ieee->stadev && 527 + ether_addr_equal(hdr->addr2, ieee->assoc_ap_addr)) { 528 528 /* Frame from BSSID of the AP for which we are a client */ 529 529 skb->dev = dev = ieee->stadev; 530 530 stats = hostap_get_stats(dev); ··· 1468 1468 * as one network */ 1469 1469 return ((src->ssid_len == dst->ssid_len) && 1470 1470 (src->channel == dst->channel) && 1471 - !compare_ether_addr(src->bssid, dst->bssid) && 1471 + ether_addr_equal(src->bssid, dst->bssid) && 1472 1472 !memcmp(src->ssid, dst->ssid, src->ssid_len)); 1473 1473 } 1474 1474
+2 -2
drivers/net/wireless/iwlegacy/3945.c
··· 453 453 switch (il->iw_mode) { 454 454 case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */ 455 455 /* packets to our IBSS update information */ 456 - return !compare_ether_addr(header->addr3, il->bssid); 456 + return ether_addr_equal(header->addr3, il->bssid); 457 457 case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */ 458 458 /* packets to our IBSS update information */ 459 - return !compare_ether_addr(header->addr2, il->bssid); 459 + return ether_addr_equal(header->addr2, il->bssid); 460 460 default: 461 461 return 1; 462 462 }
+1 -1
drivers/net/wireless/iwlegacy/4965-mac.c
··· 2565 2565 spin_lock_irqsave(&il->sta_lock, flags); 2566 2566 for (i = start; i < il->hw_params.max_stations; i++) 2567 2567 if (il->stations[i].used && 2568 - (!compare_ether_addr(il->stations[i].sta.sta.addr, addr))) { 2568 + ether_addr_equal(il->stations[i].sta.sta.addr, addr)) { 2569 2569 ret = i; 2570 2570 goto out; 2571 2571 }
+7 -7
drivers/net/wireless/iwlegacy/common.c
··· 1896 1896 sta_id = il->hw_params.bcast_id; 1897 1897 else 1898 1898 for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) { 1899 - if (!compare_ether_addr 1900 - (il->stations[i].sta.sta.addr, addr)) { 1899 + if (ether_addr_equal(il->stations[i].sta.sta.addr, 1900 + addr)) { 1901 1901 sta_id = i; 1902 1902 break; 1903 1903 } ··· 1926 1926 1927 1927 if ((il->stations[sta_id].used & IL_STA_DRIVER_ACTIVE) && 1928 1928 (il->stations[sta_id].used & IL_STA_UCODE_ACTIVE) && 1929 - !compare_ether_addr(il->stations[sta_id].sta.sta.addr, addr)) { 1929 + ether_addr_equal(il->stations[sta_id].sta.sta.addr, addr)) { 1930 1930 D_ASSOC("STA %d (%pM) already added, not adding again.\n", 1931 1931 sta_id, addr); 1932 1932 return sta_id; ··· 3744 3744 3745 3745 /* These items are only settable from the full RXON command */ 3746 3746 CHK(!il_is_associated(il)); 3747 - CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr)); 3748 - CHK(compare_ether_addr(staging->node_addr, active->node_addr)); 3749 - CHK(compare_ether_addr 3750 - (staging->wlap_bssid_addr, active->wlap_bssid_addr)); 3747 + CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr)); 3748 + CHK(!ether_addr_equal(staging->node_addr, active->node_addr)); 3749 + CHK(!ether_addr_equal(staging->wlap_bssid_addr, 3750 + active->wlap_bssid_addr)); 3751 3751 CHK_NEQ(staging->dev_type, active->dev_type); 3752 3752 CHK_NEQ(staging->channel, active->channel); 3753 3753 CHK_NEQ(staging->air_propagation, active->air_propagation);
+2 -2
drivers/net/wireless/iwlwifi/iwl-agn-rx.c
··· 779 779 */ 780 780 if (unlikely(ieee80211_is_beacon(fc) && priv->passive_no_rx)) { 781 781 for_each_context(priv, ctx) { 782 - if (compare_ether_addr(hdr->addr3, 783 - ctx->active.bssid_addr)) 782 + if (!ether_addr_equal(hdr->addr3, 783 + ctx->active.bssid_addr)) 784 784 continue; 785 785 iwlagn_lift_passive_no_rx(priv); 786 786 }
+4 -4
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
··· 881 881 882 882 /* These items are only settable from the full RXON command */ 883 883 CHK(!iwl_is_associated_ctx(ctx)); 884 - CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr)); 885 - CHK(compare_ether_addr(staging->node_addr, active->node_addr)); 886 - CHK(compare_ether_addr(staging->wlap_bssid_addr, 887 - active->wlap_bssid_addr)); 884 + CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr)); 885 + CHK(!ether_addr_equal(staging->node_addr, active->node_addr)); 886 + CHK(!ether_addr_equal(staging->wlap_bssid_addr, 887 + active->wlap_bssid_addr)); 888 888 CHK_NEQ(staging->dev_type, active->dev_type); 889 889 CHK_NEQ(staging->channel, active->channel); 890 890 CHK_NEQ(staging->air_propagation, active->air_propagation);
+3 -3
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
··· 322 322 sta_id = ctx->bcast_sta_id; 323 323 else 324 324 for (i = IWL_STA_ID; i < IWLAGN_STATION_COUNT; i++) { 325 - if (!compare_ether_addr(priv->stations[i].sta.sta.addr, 326 - addr)) { 325 + if (ether_addr_equal(priv->stations[i].sta.sta.addr, 326 + addr)) { 327 327 sta_id = i; 328 328 break; 329 329 } ··· 353 353 354 354 if ((priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE) && 355 355 (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) && 356 - !compare_ether_addr(priv->stations[sta_id].sta.sta.addr, addr)) { 356 + ether_addr_equal(priv->stations[sta_id].sta.sta.addr, addr)) { 357 357 IWL_DEBUG_ASSOC(priv, "STA %d (%pM) already added, not " 358 358 "adding again.\n", sta_id, addr); 359 359 return sta_id;
+1 -1
drivers/net/wireless/mwl8k.c
··· 1235 1235 { 1236 1236 return priv->capture_beacon && 1237 1237 ieee80211_is_beacon(wh->frame_control) && 1238 - !compare_ether_addr(wh->addr3, priv->capture_bssid); 1238 + ether_addr_equal(wh->addr3, priv->capture_bssid); 1239 1239 } 1240 1240 1241 1241 static inline void mwl8k_save_beacon(struct ieee80211_hw *hw,
+1 -1
drivers/net/wireless/p54/txrx.c
··· 308 308 return; 309 309 310 310 /* only consider beacons from the associated BSSID */ 311 - if (compare_ether_addr(hdr->addr3, priv->bssid)) 311 + if (!ether_addr_equal(hdr->addr3, priv->bssid)) 312 312 return; 313 313 314 314 tim = p54_find_ie(skb, WLAN_EID_TIM);
+6 -6
drivers/net/wireless/rndis_wlan.c
··· 1801 1801 count = max_pmkids; 1802 1802 1803 1803 for (i = 0; i < count; i++) 1804 - if (!compare_ether_addr(pmkids->bssid_info[i].bssid, 1805 - pmksa->bssid)) 1804 + if (ether_addr_equal(pmkids->bssid_info[i].bssid, 1805 + pmksa->bssid)) 1806 1806 break; 1807 1807 1808 1808 /* pmkid not found */ ··· 1843 1843 1844 1844 /* update with new pmkid */ 1845 1845 for (i = 0; i < count; i++) { 1846 - if (compare_ether_addr(pmkids->bssid_info[i].bssid, 1847 - pmksa->bssid)) 1846 + if (!ether_addr_equal(pmkids->bssid_info[i].bssid, 1847 + pmksa->bssid)) 1848 1848 continue; 1849 1849 1850 1850 memcpy(pmkids->bssid_info[i].pmkid, pmksa->pmkid, ··· 2139 2139 while (check_bssid_list_item(bssid, bssid_len, buf, len)) { 2140 2140 if (rndis_bss_info_update(usbdev, bssid) && match_bssid && 2141 2141 matched) { 2142 - if (compare_ether_addr(bssid->mac, match_bssid)) 2142 + if (!ether_addr_equal(bssid->mac, match_bssid)) 2143 2143 *matched = true; 2144 2144 } 2145 2145 ··· 2531 2531 struct rndis_wlan_private *priv = wiphy_priv(wiphy); 2532 2532 struct usbnet *usbdev = priv->usbdev; 2533 2533 2534 - if (compare_ether_addr(priv->bssid, mac)) 2534 + if (!ether_addr_equal(priv->bssid, mac)) 2535 2535 return -ENOENT; 2536 2536 2537 2537 rndis_fill_station_info(usbdev, sinfo);
+1 -1
drivers/net/wireless/rtlwifi/base.c
··· 1460 1460 return; 1461 1461 1462 1462 /* and only beacons from the associated BSSID, please */ 1463 - if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid)) 1463 + if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) 1464 1464 return; 1465 1465 1466 1466 if (rtl_find_221_ie(hw, data, len))
+1 -1
drivers/net/wireless/rtlwifi/ps.c
··· 480 480 return; 481 481 482 482 /* and only beacons from the associated BSSID, please */ 483 - if (compare_ether_addr(hdr->addr3, rtlpriv->mac80211.bssid)) 483 + if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) 484 484 return; 485 485 486 486 rtlpriv->psc.last_beacon = jiffies;
+5 -5
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
··· 508 508 509 509 packet_matchbssid = 510 510 ((IEEE80211_FTYPE_CTL != type) && 511 - (!compare_ether_addr(mac->bssid, 512 - (c_fc & IEEE80211_FCTL_TODS) ? 513 - hdr->addr1 : (c_fc & IEEE80211_FCTL_FROMDS) ? 514 - hdr->addr2 : hdr->addr3)) && 511 + ether_addr_equal(mac->bssid, 512 + (c_fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : 513 + (c_fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : 514 + hdr->addr3) && 515 515 (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); 516 516 517 517 packet_toself = packet_matchbssid && 518 - (!compare_ether_addr(praddr, rtlefuse->dev_addr)); 518 + ether_addr_equal(praddr, rtlefuse->dev_addr); 519 519 520 520 if (ieee80211_is_beacon(fc)) 521 521 packet_beacon = true;
+5 -5
drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
··· 1099 1099 praddr = hdr->addr1; 1100 1100 packet_matchbssid = 1101 1101 ((IEEE80211_FTYPE_CTL != type) && 1102 - (!compare_ether_addr(mac->bssid, 1103 - (cpu_fc & IEEE80211_FCTL_TODS) ? 1104 - hdr->addr1 : (cpu_fc & IEEE80211_FCTL_FROMDS) ? 1105 - hdr->addr2 : hdr->addr3)) && 1102 + ether_addr_equal(mac->bssid, 1103 + (cpu_fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : 1104 + (cpu_fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : 1105 + hdr->addr3) && 1106 1106 (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); 1107 1107 1108 1108 packet_toself = packet_matchbssid && 1109 - (!compare_ether_addr(praddr, rtlefuse->dev_addr)); 1109 + ether_addr_equal(praddr, rtlefuse->dev_addr); 1110 1110 if (ieee80211_is_beacon(fc)) 1111 1111 packet_beacon = true; 1112 1112 _rtl92c_query_rxphystatus(hw, pstats, pdesc, p_drvinfo,
+6 -5
drivers/net/wireless/rtlwifi/rtl8192de/trx.c
··· 466 466 type = WLAN_FC_GET_TYPE(fc); 467 467 praddr = hdr->addr1; 468 468 packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && 469 - (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ? 470 - hdr->addr1 : (cfc & IEEE80211_FCTL_FROMDS) ? 471 - hdr->addr2 : hdr->addr3)) && (!pstats->hwerror) && 472 - (!pstats->crc) && (!pstats->icv)); 469 + ether_addr_equal(mac->bssid, 470 + (cfc & IEEE80211_FCTL_TODS) ? hdr->addr1 : 471 + (cfc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : 472 + hdr->addr3) && 473 + (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); 473 474 packet_toself = packet_matchbssid && 474 - (!compare_ether_addr(praddr, rtlefuse->dev_addr)); 475 + ether_addr_equal(praddr, rtlefuse->dev_addr); 475 476 if (ieee80211_is_beacon(fc)) 476 477 packet_beacon = true; 477 478 _rtl92de_query_rxphystatus(hw, pstats, pdesc, p_drvinfo,
+6 -5
drivers/net/wireless/rtlwifi/rtl8192se/trx.c
··· 492 492 praddr = hdr->addr1; 493 493 494 494 packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && 495 - (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ? 496 - hdr->addr1 : (cfc & IEEE80211_FCTL_FROMDS) ? 497 - hdr->addr2 : hdr->addr3)) && (!pstats->hwerror) && 498 - (!pstats->crc) && (!pstats->icv)); 495 + ether_addr_equal(mac->bssid, 496 + (cfc & IEEE80211_FCTL_TODS) ? hdr->addr1 : 497 + (cfc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : 498 + hdr->addr3) && 499 + (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); 499 500 500 501 packet_toself = packet_matchbssid && 501 - (!compare_ether_addr(praddr, rtlefuse->dev_addr)); 502 + ether_addr_equal(praddr, rtlefuse->dev_addr); 502 503 503 504 if (ieee80211_is_beacon(fc)) 504 505 packet_beacon = true;