mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
39f1d94d30
commit
2e42e4747e
31 changed files with 85 additions and 86 deletions
|
@ -1801,8 +1801,8 @@ static struct ndis_80211_pmkid *remove_pmkid(struct usbnet *usbdev,
|
|||
count = max_pmkids;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
if (!compare_ether_addr(pmkids->bssid_info[i].bssid,
|
||||
pmksa->bssid))
|
||||
if (ether_addr_equal(pmkids->bssid_info[i].bssid,
|
||||
pmksa->bssid))
|
||||
break;
|
||||
|
||||
/* pmkid not found */
|
||||
|
@ -1843,8 +1843,8 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
|
|||
|
||||
/* update with new pmkid */
|
||||
for (i = 0; i < count; i++) {
|
||||
if (compare_ether_addr(pmkids->bssid_info[i].bssid,
|
||||
pmksa->bssid))
|
||||
if (!ether_addr_equal(pmkids->bssid_info[i].bssid,
|
||||
pmksa->bssid))
|
||||
continue;
|
||||
|
||||
memcpy(pmkids->bssid_info[i].pmkid, pmksa->pmkid,
|
||||
|
@ -2139,7 +2139,7 @@ resize_buf:
|
|||
while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
|
||||
if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
|
||||
matched) {
|
||||
if (compare_ether_addr(bssid->mac, match_bssid))
|
||||
if (!ether_addr_equal(bssid->mac, match_bssid))
|
||||
*matched = true;
|
||||
}
|
||||
|
||||
|
@ -2531,7 +2531,7 @@ static int rndis_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||
struct rndis_wlan_private *priv = wiphy_priv(wiphy);
|
||||
struct usbnet *usbdev = priv->usbdev;
|
||||
|
||||
if (compare_ether_addr(priv->bssid, mac))
|
||||
if (!ether_addr_equal(priv->bssid, mac))
|
||||
return -ENOENT;
|
||||
|
||||
rndis_fill_station_info(usbdev, sinfo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue