From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760316Ab2INX1X (ORCPT ); Fri, 14 Sep 2012 19:27:23 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:33366 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754423Ab2INX1W (ORCPT ); Fri, 14 Sep 2012 19:27:22 -0400 Date: Sat, 15 Sep 2012 00:27:03 +0100 From: Russell King - ARM Linux To: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Will Deacon , Nicolas Pitre , "James E.J. Bottomley" , linux-scsi@vger.kernel.org Subject: Re: [PATCH 22/24] scsi: eesox: use __iomem pointers for MMIO Message-ID: <20120914232703.GE12245@n2100.arm.linux.org.uk> References: <1347658492-11608-1-git-send-email-arnd@arndb.de> <1347658492-11608-23-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1347658492-11608-23-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 14, 2012 at 11:34:50PM +0200, Arnd Bergmann wrote: > ARM is moving to stricter checks on readl/write functions, > so we need to use the correct types everywhere. There's nothing wrong with const iomem pointers. If you think otherwise, patch x86 not to use const in its accessor implementation and watch the reaction: #define build_mmio_read(name, size, type, reg, barrier) \ static inline type name(const volatile void __iomem *addr) \ { type ret; asm volatile("mov" size " %1,%0":reg (ret) \ :"m" (*(volatile type __force *)addr) barrier); return ret; } build_mmio_read(readb, "b", unsigned char, "=q", :"memory") build_mmio_read(readw, "w", unsigned short, "=r", :"memory") build_mmio_read(readl, "l", unsigned int, "=r", :"memory")