lkml.org 
[lkml]   [2015]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] spi/xilinx: Cast ioread32/iowrite32 function pointers
Hello Arnd

On Thu, Jan 29, 2015 at 11:11 PM, Arnd Bergmann <arnd@arndb.de> 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 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).

What about the different return type? u8 vs int
Thanks

--
Ricardo Ribalda


\
 
 \ /
  Last update: 2015-01-29 23:21    [W:0.506 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site