From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758714AbbA2WMY (ORCPT ); Thu, 29 Jan 2015 17:12:24 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:62620 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758663AbbA2WMX (ORCPT ); Thu, 29 Jan 2015 17:12:23 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Ricardo Ribalda Delgado , Geert Uytterhoeven , "linux-kernel@vger.kernel.org" , Michal Simek , Mark Brown , =?ISO-8859-1?Q?S=F6ren?= Brinkmann , linux-spi Subject: Re: [PATCH] spi/xilinx: Cast ioread32/iowrite32 function pointers Date: Thu, 29 Jan 2015 23:11:47 +0100 Message-ID: <2800334.5ezTSQFkNQ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1422543073-21895-1-git-send-email-ricardo.ribalda@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Ip+xOIO0PT8G8A9ky9OTitGfhXYcH+yyzRJMWjc7XPE9aKfFENh z77nhzZdMj5/28ZK1YCVJEE7HIjVPeqsM6O6wt21/8V7JKwHGaPHImVKJT4fdvRAloqeB+G mAyvJRQNye2ZH+cCXKDqBKZNxZB+3fpUoUijKLob7ZRJewsGPvz3sTFDjtjwA3zWGNdC1oL cXgiyodH/16ENzp1xDZaA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 29 January 2015 17:39:08 Ricardo Ribalda Delgado wrote: > > I think the definitions in include/asm-generic/iomap.h are actually wrong, > > as they lack a const: > > > > extern unsigned int ioread8(void __iomem *); > > extern unsigned int ioread16(void __iomem *); > > extern unsigned int ioread16be(void __iomem *); > > extern unsigned int ioread32(void __iomem *); > > extern unsigned int ioread32be(void __iomem *); > > > > Note that the definitions in include/asm-generic/io.h do have the const: > > > > static inline u8 ioread8(const volatile void __iomem *addr) > > static inline u16 ioread16(const volatile void __iomem *addr) > > static inline u32 ioread32(const volatile void __iomem *addr) > > static inline u16 ioread16be(const volatile void __iomem *addr) > > static inline u32 ioread32be(const volatile void __iomem *addr) > > > I think you are right: ioread/iowrite is poorly implemented in many arches > > Would you mind sending the patch for asm-generic/iomap ? Or you want > me to do it. > I think we don't need the 'volatile' keyword here. The main reason we have it on readl() is to shut up the compiler when dealing with ancient driver code that annotates iomem pointers as volatile. This is generally considered a (minor) driver mistake though, and modern drivers that for some reason use ioread*() typically don't do that (or they get a warning). Arnd