mwifiex: slight optimization of addr compare
authordingtianhong <dingtianhong@huawei.com>
Thu, 26 Dec 2013 11:41:27 +0000 (19:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Dec 2013 18:31:35 +0000 (13:31 -0500)
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Bing Zhao <bzhao@marvell.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/mwifiex/11n.c
drivers/net/wireless/mwifiex/sta_cmdresp.c
drivers/net/wireless/mwifiex/sta_rx.c

index 0b803c05cab3dae49be31b61b6cddb7e60674955..6261f8c53d44bd7a6ba4f30651bfc8c67da6f4e5 100644 (file)
@@ -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);
index 551194605aa7ae1862c2df113b33a8701c8d5243..24523e4015cba11a9fe02ee449ad462f557e1642 100644 (file)
@@ -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);
index 0bb510de80710a1348c1743ca95fbe107ef223e7..4651d676df380c16f9ec8577a1f97e4ab72a4b8c 100644 (file)
@@ -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;
        }