Skip to contentSkip to conversation

hamradio: slight optimization of addr compare

PATCH Superseded Ding Tianhong 1 participant 1 message Dec 23, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 20/21 hamradio: slight optimization of addr compare

Use the recently added and possibly more efficient ether_addr_equal_unaligned to instead of memcmp.

---
 drivers/net/hamradio/bpqether.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hamradio/bpqether.c +1 -1
index f91bf0d..61eae6e 100644
@@ -208,7 +208,7 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
 	eth = eth_hdr(skb);
 
 	if (!(bpq->acpt_addr[0] & 0x01) &&
-	    memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN))
+	    !ether_addr_equal_unaligned(eth->h_source, bpq->acpt_addr))
 		goto drop_unlock;
 
 	if (skb_cow(skb, sizeof(struct ethhdr)))
Signature · 1 line
1.8.0