Re: Documentation/unaligned-memory-access.txt: fix incorrect comparison operator

From: Cihangir Akturk
Date: Mon Dec 19 2016 - 19:22:36 EST


On Sun, Dec 18, 2016 at 12:52:12AM +0200, Ozgur Karatas wrote:
> 17.12.2016, 19:43, "Cihangir Akturk" <cakturk@xxxxxxxxx>:
> > In the actual implementation ether_addr_equal function tests for equality to 0
> > when returning. It seems in commit 0d74c4 it is somehow overlooked to change
> > this operator to reflect the actual function.
>
> why this "return" function need to be ==0? I think, u16 functions read memory but "0" is should not be equalty.

XOR is true only when inputs differ. That means if inputs are the
same, then it outputs false (0) or whatever you call it. Then we
perform OR operation between those outputs. So if the result is 0 then
addr1 and addr2 is equal.

> This way, -for the code to work- memory should be everytime unaligned !=0.

Sorry I didn't quite get the point.