From: Ozgur Karatas <okaratas@member.fsf.org>
To: Cihangir Akturk <cakturk@gmail.com>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Documentation/unaligned-memory-access.txt: fix incorrect comparison operator
Date: Tue, 20 Dec 2016 11:51:51 +0200 [thread overview]
Message-ID: <1881701482227511@web3j.yandex.ru> (raw)
In-Reply-To: <20161220002226.GB2970@portege.localdomain>
20.12.2016, 02:22, "Cihangir Akturk" <cakturk@gmail.com>:
> On Sun, Dec 18, 2016 at 12:52:12AM +0200, Ozgur Karatas wrote:
>> 17.12.2016, 19:43, "Cihangir Akturk" <cakturk@gmail.com>:
>> > 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.
Thanks for this explanation to your patch. In this case the patch mentioned is valid.
I checked, turned to "!=0" errors.
un-mem.c:29:18: error: ‘!’ (first use in this function)
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
^
Also, don't need to send patch it secon time :)
>> This way, -for the code to work- memory should be everytime unaligned !=0.
>
> Sorry I didn't quite get the point.
Regards,
~Ozgur
next prev parent reply other threads:[~2016-12-20 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-17 17:42 Cihangir Akturk
2016-12-17 22:52 ` Ozgur Karatas
2016-12-20 0:22 ` Cihangir Akturk
2016-12-20 9:51 ` Ozgur Karatas [this message]
2016-12-27 20:09 ` Jonathan Corbet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1881701482227511@web3j.yandex.ru \
--to=okaratas@member.fsf.org \
--cc=cakturk@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®