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

Cc: Joerg Reuter <jreuter@yaina.de>
Cc: linux-hams@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/bpqether.c

index f91bf0d..d50b23c 100644 (file)
@@ -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(eth->h_source, bpq->acpt_addr))
                goto drop_unlock;
 
        if (skb_cow(skb, sizeof(struct ethhdr)))