Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c1120b6 authored by dingtianhong's avatar dingtianhong Committed by David S. Miller
Browse files

net: cxgb3: slight optimization of addr compare



Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Santosh Raspatur <santosh@chelsio.com>
Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8fd90de8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,
	for_each_port(adapter, i) {
		struct net_device *dev = adapter->port[i];

		if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) {
		if (ether_addr_equal(dev->dev_addr, mac)) {
			rcu_read_lock();
			if (vlan && vlan != VLAN_VID_MASK) {
				dev = __vlan_find_dev_deep(dev, htons(ETH_P_8021Q), vlan);
+1 −1
Original line number Diff line number Diff line
@@ -429,7 +429,7 @@ void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh)
		} else {
			e->state = neigh->nud_state & NUD_CONNECTED ?
			    L2T_STATE_VALID : L2T_STATE_STALE;
			if (memcmp(e->dmac, neigh->ha, 6))
			if (!ether_addr_equal(e->dmac, neigh->ha))
				setup_l2e_send_pending(dev, NULL, e);
		}
	}