* [PATCH] sata_svw: Fix __iomem related warnings
@ 2004-09-13 4:27 Benjamin Herrenschmidt
2004-09-13 8:36 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-09-13 4:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linus Torvalds, Linux Kernel list, Jeff Garzik
This patch adds some (ugly) casts to sata_svw to remove the
warnings generated by the new iomem stuff.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
===== drivers/scsi/sata_svw.c 1.23 vs edited =====
--- 1.23/drivers/scsi/sata_svw.c 2004-08-15 05:37:54 +10:00
+++ edited/drivers/scsi/sata_svw.c 2004-09-13 14:21:14 +10:00
@@ -103,26 +103,31 @@
unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
if (tf->ctl != ap->last_ctl) {
- writeb(tf->ctl, ioaddr->ctl_addr);
+ writeb(tf->ctl, (void __iomem *)ioaddr->ctl_addr);
ap->last_ctl = tf->ctl;
ata_wait_idle(ap);
}
if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
- writew(tf->feature | (((u16)tf->hob_feature) << 8), ioaddr->feature_addr);
- writew(tf->nsect | (((u16)tf->hob_nsect) << 8), ioaddr->nsect_addr);
- writew(tf->lbal | (((u16)tf->hob_lbal) << 8), ioaddr->lbal_addr);
- writew(tf->lbam | (((u16)tf->hob_lbam) << 8), ioaddr->lbam_addr);
- writew(tf->lbah | (((u16)tf->hob_lbah) << 8), ioaddr->lbah_addr);
+ writew(tf->feature | (((u16)tf->hob_feature) << 8),
+ (void __iomem *)ioaddr->feature_addr);
+ writew(tf->nsect | (((u16)tf->hob_nsect) << 8),
+ (void __iomem *)ioaddr->nsect_addr);
+ writew(tf->lbal | (((u16)tf->hob_lbal) << 8),
+ (void __iomem *)ioaddr->lbal_addr);
+ writew(tf->lbam | (((u16)tf->hob_lbam) << 8),
+ (void __iomem *)ioaddr->lbam_addr);
+ writew(tf->lbah | (((u16)tf->hob_lbah) << 8),
+ (void __iomem *)ioaddr->lbah_addr);
} else if (is_addr) {
- writew(tf->feature, ioaddr->feature_addr);
- writew(tf->nsect, ioaddr->nsect_addr);
- writew(tf->lbal, ioaddr->lbal_addr);
- writew(tf->lbam, ioaddr->lbam_addr);
- writew(tf->lbah, ioaddr->lbah_addr);
+ writew(tf->feature, (void __iomem *)ioaddr->feature_addr);
+ writew(tf->nsect, (void __iomem *)ioaddr->nsect_addr);
+ writew(tf->lbal, (void __iomem *)ioaddr->lbal_addr);
+ writew(tf->lbam, (void __iomem *)ioaddr->lbam_addr);
+ writew(tf->lbah, (void __iomem *)ioaddr->lbah_addr);
}
if (tf->flags & ATA_TFLAG_DEVICE)
- writeb(tf->device, ioaddr->device_addr);
+ writeb(tf->device, (void __iomem *)ioaddr->device_addr);
ata_wait_idle(ap);
}
@@ -133,14 +138,14 @@
struct ata_ioports *ioaddr = &ap->ioaddr;
u16 nsect, lbal, lbam, lbah;
- nsect = tf->nsect = readw(ioaddr->nsect_addr);
- lbal = tf->lbal = readw(ioaddr->lbal_addr);
- lbam = tf->lbam = readw(ioaddr->lbam_addr);
- lbah = tf->lbah = readw(ioaddr->lbah_addr);
- tf->device = readw(ioaddr->device_addr);
+ nsect = tf->nsect = readw((void __iomem *)ioaddr->nsect_addr);
+ lbal = tf->lbal = readw((void __iomem *)ioaddr->lbal_addr);
+ lbam = tf->lbam = readw((void __iomem *)ioaddr->lbam_addr);
+ lbah = tf->lbah = readw((void __iomem *)ioaddr->lbah_addr);
+ tf->device = readw((void __iomem *)ioaddr->device_addr);
if (tf->flags & ATA_TFLAG_LBA48) {
- tf->hob_feature = readw(ioaddr->error_addr) >> 8;
+ tf->hob_feature = readw((void __iomem *)ioaddr->error_addr) >> 8;
tf->hob_nsect = nsect >> 8;
tf->hob_lbal = lbal >> 8;
tf->hob_lbam = lbam >> 8;
@@ -151,7 +156,7 @@
static u8 k2_stat_check_status(struct ata_port *ap)
{
- return readl((void *) ap->ioaddr.status_addr);
+ return readl((void __iomem *) ap->ioaddr.status_addr);
}
#ifdef CONFIG_PPC_OF
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sata_svw: Fix __iomem related warnings
2004-09-13 4:27 [PATCH] sata_svw: Fix __iomem related warnings Benjamin Herrenschmidt
@ 2004-09-13 8:36 ` Christoph Hellwig
2004-09-13 13:19 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2004-09-13 8:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Andrew Morton, Linus Torvalds, Linux Kernel list, Jeff Garzik
On Mon, Sep 13, 2004 at 02:27:22PM +1000, Benjamin Herrenschmidt wrote:
> This patch adds some (ugly) casts to sata_svw to remove the
> warnings generated by the new iomem stuff.
Umm, maybe it's just me - but shouldn't you fix them properly?
>
> - writeb(tf->ctl, ioaddr->ctl_addr);
> + writeb(tf->ctl, (void __iomem *)ioaddr->ctl_addr);
e.g. ioaddr->ctl_addr should get a __iomem attribute
> + writew(tf->feature | (((u16)tf->hob_feature) << 8),
> + (void __iomem *)ioaddr->feature_addr);
> + writew(tf->nsect | (((u16)tf->hob_nsect) << 8),
> + (void __iomem *)ioaddr->nsect_addr);
> + writew(tf->lbal | (((u16)tf->hob_lbal) << 8),
> + (void __iomem *)ioaddr->lbal_addr);
> + writew(tf->lbam | (((u16)tf->hob_lbam) << 8),
> + (void __iomem *)ioaddr->lbam_addr);
> + writew(tf->lbah | (((u16)tf->hob_lbah) << 8),
> + (void __iomem *)ioaddr->lbah_addr);
dito for all the others.
just hacking around the annotations with casts seems ather pointless.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sata_svw: Fix __iomem related warnings
2004-09-13 8:36 ` Christoph Hellwig
@ 2004-09-13 13:19 ` Jeff Garzik
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2004-09-13 13:19 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Benjamin Herrenschmidt, Andrew Morton, Linus Torvalds,
Linux Kernel list
Christoph Hellwig wrote:
> On Mon, Sep 13, 2004 at 02:27:22PM +1000, Benjamin Herrenschmidt wrote:
>
>>This patch adds some (ugly) casts to sata_svw to remove the
>>warnings generated by the new iomem stuff.
>
>
> Umm, maybe it's just me - but shouldn't you fix them properly?
>
>
>>- writeb(tf->ctl, ioaddr->ctl_addr);
>>+ writeb(tf->ctl, (void __iomem *)ioaddr->ctl_addr);
>
>
> e.g. ioaddr->ctl_addr should get a __iomem attribute
Wrong. Read the code.
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-09-13 13:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-13 4:27 [PATCH] sata_svw: Fix __iomem related warnings Benjamin Herrenschmidt
2004-09-13 8:36 ` Christoph Hellwig
2004-09-13 13:19 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox