All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 05/20] net: benet: slight optimization of addr compare
@ 2013-12-28  6:17 Ding Tianhong
  0 siblings, 0 replies; only message in thread
From: Ding Tianhong @ 2013-12-28  6:17 UTC (permalink / raw)
  To: Sathya Perla, Subbu Seetharaman, Ajit Khaparde, David S. Miller,
	Netdev, linux-kernel@vger.kernel.org

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f67586a..b5c238a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -287,7 +287,7 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
 	/* The MAC change did not happen, either due to lack of privilege
 	 * or PF didn't pre-provision.
 	 */
-	if (memcmp(addr->sa_data, mac, ETH_ALEN)) {
+	if (!ether_addr_equal(addr->sa_data, mac)) {
 		status = -EPERM;
 		goto err;
 	}
-- 
1.8.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-28  6:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28  6:17 [PATCH net-next v2 05/20] net: benet: slight optimization of addr compare Ding Tianhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.