Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753050AbbLID6o (ORCPT ); Tue, 8 Dec 2015 22:58:44 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:49835 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbbLID6m (ORCPT ); Tue, 8 Dec 2015 22:58:42 -0500 Date: Tue, 08 Dec 2015 22:58:41 -0500 (EST) Message-Id: <20151208.225841.2073281401429339939.davem@davemloft.net> To: arnd@arndb.de Cc: noamc@ezchip.com, talz@ezchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] net: ezchip: fix address space confusion in nps_enet.c From: David Miller In-Reply-To: <33732958.3idC7H2UPT@wuerfel> References: <33732958.3idC7H2UPT@wuerfel> 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]); Tue, 08 Dec 2015 19:58:42 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1449 Lines: 34 From: Arnd Bergmann Date: Tue, 08 Dec 2015 16:28:59 +0100 > The nps_enet driver happily mixes virtual, physical and __iomem > addresses, which are all different depending on the architecture > and configuration. That causes a warning when building the code > on ARM with LPAE mode enabled: > > drivers/net/ethernet/ezchip/nps_enet.c: In function 'nps_enet_send_frame': > drivers/net/ethernet/ezchip/nps_enet.c:370:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > > but will also fail to work for other reasons. > > In this patch, I'm trying to change the code to use only normal > kernel pointers, which I assume is what the author actually meant: > > * For reading or writing a 32-bit word that may be unaligned when > an SKB contains unaligned data, I'm using get_unaligned/put_unaligned() > rather than memcpy_fromio/toio. > > * For converting a u8 pointer to a u32 pointer, I use a cast rather > than the incorrect virt_to_phys. > > * For copying a couple of bytes from one place to another while respecting > alignment, I use memcpy instead of memcpy_toio. > > Signed-off-by: Arnd Bergmann Applied, thanks Arnd. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/