[ovs-dev] [PATCH] packets: Remove unneeded !! from eth_addr_is_local().

Ben Pfaff blp at nicira.com
Fri Jul 8 17:47:24 UTC 2011


There's no value in using !! on an operand of && or || as done here.
---
 lib/packets.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/packets.h b/lib/packets.h
index 20065ad..8e13a25 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -56,8 +56,8 @@ static inline bool eth_addr_is_local(const uint8_t ea[6])
 {
     /* Local if it is either a locally administered address or a Nicira random
      * address. */
-    return !!(ea[0] & 2)
-       || (ea[0] == 0x00 && ea[1] == 0x23 && ea[2] == 0x20 && !!(ea[3] & 0x80));
+    return ea[0] & 2
+       || (ea[0] == 0x00 && ea[1] == 0x23 && ea[2] == 0x20 && ea[3] & 0x80);
 }
 static inline bool eth_addr_is_zero(const uint8_t ea[6])
 {
-- 
1.7.4.4




More information about the dev mailing list