mwifiex: slight optimization of addr compare
Subsystems (3)
PATCH 17/19 mwifiex: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.
--- drivers/net/wireless/mwifiex/11n.c | 2 +- drivers/net/wireless/mwifiex/sta_cmdresp.c | 3 +-- drivers/net/wireless/mwifiex/sta_rx.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/mwifiex/11n.c +1 -1
@@ -483,7 +483,7 @@ mwifiex_get_ba_tbl(struct mwifiex_private *priv, int tid, u8 *ra)spin_lock_irqsave (&priv->tx_ba_stream_tbl_lock, flags);list_for_each_entry (tx_ba_tsr_tbl, &priv->tx_ba_stream_tbl_ptr, list) { -if (!memcmp (tx_ba_tsr_tbl->ra, ra,ETH_ALEN ) && +if (ether_addr_equal_unaligned (tx_ba_tsr_tbl->ra, ra) && tx_ba_tsr_tbl->tid == tid) {spin_unlock_irqrestore (&priv->tx_ba_stream_tbl_lock, flags);
drivers/net/wireless/mwifiex/sta_cmdresp.c +1 -2
@@ -782,8 +782,7 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, }/* If BSSID is diff, modify current BSS parameters */ -if (memcmp (priv->curr_bss_params.bss_descriptor.mac_address, - ibss_coal_resp->bssid,ETH_ALEN )) { +if (!ether_addr_equal (priv->curr_bss_params.bss_descriptor.mac_address, ibss_coal_resp->bssid)) {/* BSSID */ memcpy (priv->curr_bss_params.bss_descriptor.mac_address, ibss_coal_resp->bssid,ETH_ALEN );
drivers/net/wireless/mwifiex/sta_rx.c +1 -1
@@ -224,7 +224,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_private *priv,* directly to os. Don't pass thru rx reordering */ if (!IS_11N_ENABLED (priv) || -memcmp (priv->curr_addr, rx_pkt_hdr->eth803_hdr.h_dest,ETH_ALEN )) { + !ether_addr_equal_unaligned (priv->curr_addr, rx_pkt_hdr->eth803_hdr.h_dest)) {mwifiex_process_rx_packet (priv, skb);return ret; }
Signature · 1 line
1.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GhhbmtzLA0KQmlu Zw0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · Bing Zhao
Hi Ding,
drivers/net/wireless/mwifiex/sta_cmdresp.c static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, · line 785
Quoted 10 lines
Use possibly more efficient
ether_addr_equal
instead of memcmp.drivers/net/wireless/mwifiex/sta_cmdresp.c +1
-2@@ -782,8 +782,7 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, }/* If BSSID is diff, modify current BSS parameters */ -if (memcmp (priv->curr_bss_params.bss_descriptor.mac_address, - ibss_coal_resp->bssid,ETH_ALEN )) { +if (!ether_addr_equal (priv->curr_bss_params.bss_descriptor.mac_address, ibss_coal_resp->bssid))Could you break the line?
If you run "checkpatch.pl" you will spot this warning.
Quoted 9 lines
drivers/net/wireless/mwifiex/sta_rx.c int mwifiex_process_sta_rx_packet(struct mwifiex_private *priv, · line 227
Quoted 3 lines
drivers/net/wireless/mwifiex/sta_rx.c +1
-1if (!IS_11N_ENABLED (priv) || -memcmp (priv->curr_addr, rx_pkt_hdr->eth803_hdr.h_dest,ETH_ALEN )) { + !ether_addr_equal_unaligned (priv->curr_addr, rx_pkt_hdr->eth803_hdr.h_dest)) {Also over 80 characters here.
Thanks,
Bing
Ok, thanks
Regards
Ding
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html