Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759304AbcLQWwQ (ORCPT ); Sat, 17 Dec 2016 17:52:16 -0500 Received: from forward4o.cmail.yandex.net ([37.9.109.248]:33566 "EHLO forward4o.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbcLQWwP (ORCPT ); Sat, 17 Dec 2016 17:52:15 -0500 Authentication-Results: mxback5g.mail.yandex.net; dkim=pass header.i=@yandex.com.tr From: Ozgur Karatas Envelope-From: mueddib@yandex.com.tr To: Cihangir Akturk , "corbet@lwn.net" Cc: "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" In-Reply-To: <1481996537-24721-1-git-send-email-cakturk@gmail.com> References: <1481996537-24721-1-git-send-email-cakturk@gmail.com> Subject: Re: Documentation/unaligned-memory-access.txt: fix incorrect comparison operator MIME-Version: 1.0 Message-Id: <6609661482015132@web29g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 18 Dec 2016 00:52:12 +0200 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1213 Lines: 29 17.12.2016, 19:43, "Cihangir Akturk" : > 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. This way, -for the code to work- memory should be everytime unaligned !=0. > Signed-off-by: Cihangir Akturk > --- >  Documentation/unaligned-memory-access.txt | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt > index a445da0..3f76c0c 100644 > --- a/Documentation/unaligned-memory-access.txt > +++ b/Documentation/unaligned-memory-access.txt > @@ -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 >  } > > -- > 2.1.4