lkml.org 
[lkml]   [2011]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 01/11] mfd: add pruss mfd driver.
Date
My problem is, I am doing something like this:

s32 pruss_writel_multi(struct device *dev, u32 offset,
u32 *pdatatowrite, u16 wordstowrite)
{
struct pruss_priv *pruss = dev_get_drvdata(dev->parent);
u32 __iomem *paddresstowrite;
u16 i;

paddresstowrite = pruss->ioaddr + offset;

for (i = 0; i < wordstowrite; i++)
iowrite32(*pdatatowrite++, paddresstowrite++);

return 0;
}

So, if I make paddresstowrite as void, it will not work.
The above implementation does not generate any sparse errors though.


> On Wed, Apr 27, 2011 at 09:29:59AM +0200, Marc Kleine-Budde wrote:
>> On 04/27/2011 08:39 AM, Subhasish Ghosh wrote:
>> > - Is it ok to have u32 etc for __iomem cookie ?
>>
>> no - "void __iomem *" is "void __iomem *"
>
> Actually, it is _provided_ you don't directly dereference it. You can
> then do pointer arithmetic on it in the usual way - which is about the
> only valid thing to do with an __iomem pointer. The voidness just acts
> as an additional check against direct dereferences of this.
>
> The important thing though is that the code passes sparse checks.


\
 
 \ /
  Last update: 2011-04-27 15:21    [W:0.127 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site