From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754657AbcFQAPz (ORCPT ); Thu, 16 Jun 2016 20:15:55 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:44483 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753996AbcFQAPy (ORCPT ); Thu, 16 Jun 2016 20:15:54 -0400 Date: Thu, 16 Jun 2016 17:15:52 -0700 (PDT) Message-Id: <20160616.171552.314643580473023970.davem@davemloft.net> To: arnd@arndb.de Cc: f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dsa: b53: fix big-endian register access From: David Miller In-Reply-To: <20160616090017.912604-1-arnd@arndb.de> References: <20160616090017.912604-1-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 16 Jun 2016 17:15:53 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Thu, 16 Jun 2016 11:00:05 +0200 > The b53 dsa register access confusingly uses __raw register accessors > when both the CPU and the device are big-endian, but it uses little- > endian accessors when the same device is used from a little-endian > CPU, which makes no sense. > > This uses normal accessors in device-endianess all the time, which > will work in all four combinations of register and CPU endianess, > and it will have the same barrier semantics in all cases. > > This also seems to take care of a (false positive) warning I'm getting: > > drivers/net/dsa/b53/b53_mmap.c: In function 'b53_mmap_read64': > drivers/net/dsa/b53/b53_mmap.c:109:10: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized] > *val = ((u64)hi << 32) | lo; > > I originally planned to submit another patch for that warning > and did this one as a preparation cleanup, but it does seem to be > sufficient by itself. > > Signed-off-by: Arnd Bergmann Applied.