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

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

 



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 [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