wireless: slight optimization of addr compare
Use possibly more efficient ether_addr_equal or ether_addr_equal_unaligned instead of memcmp. Cc: John W. Linville <linville@tuxdriver.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Weilong Chen <chenweilong@huawei.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4f29739bb0
commit
692e5167b4
@@ -24,6 +24,7 @@
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/etherdevice.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
@@ -1860,7 +1861,7 @@ prism54_del_mac(struct net_device *ndev, struct iw_request_info *info,
|
||||
if (mutex_lock_interruptible(&acl->lock))
|
||||
return -ERESTARTSYS;
|
||||
list_for_each_entry(entry, &acl->mac_list, _list) {
|
||||
if (memcmp(entry->addr, addr->sa_data, ETH_ALEN) == 0) {
|
||||
if (ether_addr_equal(entry->addr, addr->sa_data)) {
|
||||
list_del(&entry->_list);
|
||||
acl->size--;
|
||||
kfree(entry);
|
||||
|
Reference in New Issue
Block a user