Hello.

On 27-12-2013 10:48, Ding Tianhong wrote:

Use the possibly more efficient ether_addr_equal or
ether_addr_equal_unaligned to instead of memcmp.

Cc: Ariel Elior <ari...@broadcom.com>
Signed-off-by: Ding Tianhong <dingtianh...@huawei.com>
---
  drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c    | 10 ++++------
  drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c |  2 +-
  drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c  |  2 +-
  3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 32c92ab..a83c67c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
[...]
@@ -696,8 +696,7 @@ static int bnx2x_check_vlan_mac_add(struct bnx2x *bp,

        list_for_each_entry(pos, &o->head, link)
                if ((data->vlan_mac.vlan == pos->u.vlan_mac.vlan) &&
-                   (!memcmp(data->vlan_mac.mac, pos->u.vlan_mac.mac,
-                                 ETH_ALEN)) &&
+                   (ether_addr_equal_unaligned(data->vlan_mac.mac, 
pos->u.vlan_mac.mac)) &&

   Pointless parens around function call again.

@@ -716,7 +715,7 @@ static struct bnx2x_vlan_mac_registry_elem *
        DP(BNX2X_MSG_SP, "Checking MAC %pM for DEL command\n", data->mac.mac);

        list_for_each_entry(pos, &o->head, link)
-               if ((!memcmp(data->mac.mac, pos->u.mac.mac, ETH_ALEN)) &&
+               if ((ether_addr_equal(data->mac.mac, pos->u.mac.mac)) &&

   ... and again.

@@ -751,8 +750,7 @@ static struct bnx2x_vlan_mac_registry_elem *

        list_for_each_entry(pos, &o->head, link)
                if ((data->vlan_mac.vlan == pos->u.vlan_mac.vlan) &&
-                   (!memcmp(data->vlan_mac.mac, pos->u.vlan_mac.mac,
-                            ETH_ALEN)) &&
+                   (ether_addr_equal_unaligned(data->vlan_mac.mac, 
pos->u.vlan_mac.mac)) &&

   ... and again.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to