Re: [PATCH] Add cast to __iomem pointer in scsi drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Tue, 14 Feb 2006 15:46:22 -0500,
Mark Lord wrote:
> 
> 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.

Yes, that'll be the best solution.  But, in these drivers, the same
struct fields are used for both inl() and writel() depending on the
flag, so you cannot change the type.

Hm, looks like I hit a dreadful case without a good solution.


Takashi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux