From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Subject: [PATCH libata:upstream] remove compiler warnings
Date: Mon, 22 Aug 2005 18:11:29 +0900 [thread overview]
Message-ID: <20050822091129.GA15373@htj.dyndns.org> (raw)
Hello, Jeff.
This patch removes compiler warnings which are caused by using
ioports values (unsigned long) for the address argument of
read/write[bwl]() functions without casting.
Signed-off-by: Tejun Heo <htejun@gmail.com>
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -103,26 +103,31 @@ static void k2_sata_tf_load(struct ata_p
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);
+ u16 feature = tf->feature | (((u16)tf->hob_feature) << 8);
+ u16 nsect = tf->nsect | (((u16)tf->hob_nsect) << 8);
+ u16 lbal = tf->lbal | (((u16)tf->hob_lbal) << 8);
+ u16 lbam = tf->lbam | (((u16)tf->hob_lbam) << 8);
+ u16 lbah = tf->lbah | (((u16)tf->hob_lbah) << 8);
+ writew(feature, (void __iomem *)ioaddr->feature_addr);
+ writew(nsect, (void __iomem *)ioaddr->nsect_addr);
+ writew(lbal, (void __iomem *)ioaddr->lbal_addr);
+ writew(lbam, (void __iomem *)ioaddr->lbam_addr);
+ writew(lbah, (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 @@ static void k2_sata_tf_read(struct ata_p
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;
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -81,10 +81,10 @@ static void vsc_sata_scr_write (struct a
static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl)
{
- unsigned long mask_addr;
+ void __iomem *mask_addr;
u8 mask;
- mask_addr = (unsigned long) ap->host_set->mmio_base +
+ mask_addr = ap->host_set->mmio_base +
VSC_SATA_INT_MASK_OFFSET + ap->port_no;
mask = readb(mask_addr);
if (ctl & ATA_NIEN)
@@ -110,21 +110,26 @@ static void vsc_sata_tf_load(struct ata_
vsc_intr_mask_update(ap, tf->ctl & ATA_NIEN);
}
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);
+ u16 feature = tf->feature | (((u16)tf->hob_feature) << 8);
+ u16 nsect = tf->nsect | (((u16)tf->hob_nsect) << 8);
+ u16 lbal = tf->lbal | (((u16)tf->hob_lbal) << 8);
+ u16 lbam = tf->lbam | (((u16)tf->hob_lbam) << 8);
+ u16 lbah = tf->lbah | (((u16)tf->hob_lbah) << 8);
+ writew(feature, (void __iomem *)ioaddr->feature_addr);
+ writew(nsect, (void __iomem *)ioaddr->nsect_addr);
+ writew(lbal, (void __iomem *)ioaddr->lbal_addr);
+ writew(lbam, (void __iomem *)ioaddr->lbam_addr);
+ writew(lbah, (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);
}
@@ -135,14 +140,14 @@ static void vsc_sata_tf_read(struct ata_
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 = readb(ioaddr->error_addr);
+ tf->hob_feature = readb((void __iomem *)ioaddr->error_addr);
tf->hob_nsect = nsect >> 8;
tf->hob_lbal = lbal >> 8;
tf->hob_lbam = lbam >> 8;
@@ -251,8 +256,8 @@ static void __devinit vsc_sata_setup_por
port->ctl_addr = base + VSC_SATA_TF_CTL_OFFSET;
port->bmdma_addr = base + VSC_SATA_DMA_CMD_OFFSET;
port->scr_addr = base + VSC_SATA_SCR_STATUS_OFFSET;
- writel(0, base + VSC_SATA_UP_DESCRIPTOR_OFFSET);
- writel(0, base + VSC_SATA_UP_DATA_BUFFER_OFFSET);
+ writel(0, (void __iomem *)base + VSC_SATA_UP_DESCRIPTOR_OFFSET);
+ writel(0, (void __iomem *)base + VSC_SATA_UP_DATA_BUFFER_OFFSET);
}
next reply other threads:[~2005-08-22 22:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-22 9:11 Tejun Heo [this message]
2005-08-22 19:50 ` libata TODO: ioread/iowrite work (was Re: [PATCH libata:upstream] remove compiler warnings) Jeff Garzik
2005-08-22 20:39 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050822091129.GA15373@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).