Skip to contentSkip to conversation

doc: Fix comparison operator

PATCH New Marek Vasut 1 participant 1 message Oct 10, 2014 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: Fix comparison operator

From: Olaf Mandel <[email protected]>

Align the documentation with the include/linux/etherdevice.h , which is where this example comes from. The return value from the check was inverted in the documentation.

---
 Documentation/unaligned-memory-access.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/unaligned-memory-access.txt +1 -1
index a445da0..3f76c0c 100644
@@ -151,7 +151,7 @@ bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 #else
 	const u16 *a = (const u16 *)addr1;
 	const u16 *b = (const u16 *)addr2;
-	return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
+	return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0;
 #endif
 }
 
Signature · 1 line
2.0.0