Skip to contentSkip to conversation

doc: Fix comparison operator

PATCH In review Marek Vasut 2 participants 2 messages Oct 10, 2014 – Oct 27, 2014

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.

---
 doc/README.unaligned-memory-access.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/README.unaligned-memory-access.txt +1 -1
index 00529f5..70a85f9 100644
@@ -154,7 +154,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
#1 lore raw
Quoted 10 lines · Marek Vasut

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141027/5b146316/attachment.pgp>