aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-11-01 19:52:11 -0500
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-11-02 18:54:07 -0500
commit2407534f8be8015d585104bcc4374870b6b70fe7 (patch)
treefba7cb22827991ccf447824a6b2d66a543b27e21 /include
parent450b5b18983cc15f4d27bd3f62901e02281e818b (diff)
[ETHERNET]: Optimize is_broadcast_ether_addr
Optimize the match for broadcast address by using bit operations instead of comparison. This saves a number of conditional branches, and generates smaller code. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/etherdevice.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index cc84934f9059..17460c85df7b 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -71,8 +71,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
71 71
72static inline int is_broadcast_ether_addr(const u8 *addr) 72static inline int is_broadcast_ether_addr(const u8 *addr)
73{ 73{
74 return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && 74 return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff;
75 (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
76} 75}
77 76
78/** 77/**