lkml.org 
[lkml]   [2006]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Add cast to __iomem pointer in scsi drivers
Takashi Iwai wrote:
> At Tue, 14 Feb 2006 15:35:29 -0500,
> linux-os (Dick Johnson) wrote:
>>
>> On Tue, 14 Feb 2006, Takashi Iwai wrote:
>>
>>> Add the missing cast to __iomem pointer in some scsi drivers.
..
>>> -#define WROUTDOOR(adapter,value) writel(value, (adapter)->base + 0x2C)
...
>>> +#define WROUTDOOR(adapter,value) writel(value, (void __iomem *)((adapter)->base + 0x2C))
..
>> With all these casts, doesn't it point out that something is wrong
>> with writel(), writew(), readl(), and readw() ??? The cast's to
>> volatile types should be within the macros, not scattered
>> throughout everyone's driver code!
>
> The patch is just for fixing compile warnings.
>
> readl(), writel() and co are inline functions, and they should be cast
> explicitly on the caller side.

I think Linus's intent when he added the __iomem "feature", was that code
should change the underlying data declarations to match. So rather than
casting things left and right, and defeating compiler diagnostics by doing so,
perhaps the actual data type for "base" et al. should get changed to match.

Cheers
-
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/

\
 
 \ /
  Last update: 2006-02-14 21:48    [W:0.040 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site