Skip to contentSkip to conversation

:2.6.9-rc4: Fixes a bunch of compiler warnings

PATCH In review Ricky lloyd 2 participants 2 messages Oct 11, 2004 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 :2.6.9-rc4: Fixes a bunch of compiler warnings

attaching a patch diff'ed against 2.6.9-rc4. Fixes a whole bunch of compiler warnings of the
kind, "warning: passing arg 1 of `readl' makes pointer from integer without a cast"

Signature · 1 line
-> Ricky
net/tulip/dmfe.c +2 -2
diff -purN drivers/net/tulip/dmfe.c drivers-fix/net/tulip/dmfe.c
@@ -1805,7 +1805,7 @@ static void dmfe_parse_srom(struct dmfe_
 	if ( ( (int) srom[18] & 0xff) == SROM_V41_CODE) {
 		/* SROM V4.01 */
 		/* Get NIC support media mode */
-		db->NIC_capability = le16_to_cpup(srom + 34);
+		db->NIC_capability = le16_to_cpup((__le16 *)(srom + 34));
 		db->PHY_reg4 = 0;
 		for (tmp_reg = 1; tmp_reg < 0x10; tmp_reg <<= 1) {
 			switch( db->NIC_capability & tmp_reg ) {
@@ -1817,7 +1817,7 @@ static void dmfe_parse_srom(struct dmfe_
 		}
 
 		/* Media Mode Force or not check */
-		dmfe_mode = le32_to_cpup(srom + 34) & le32_to_cpup(srom + 36);
+		dmfe_mode = le32_to_cpup((__le32 *)(srom + 34)) & le32_to_cpup((__le32 *)(srom + 36));
 		switch(dmfe_mode) {
 		case 0x4: dmfe_media_mode = DMFE_100MHF; break;	/* 100MHF */
 		case 0x2: dmfe_media_mode = DMFE_10MFD; break;	/* 10MFD */
net/tulip/winbond-840.c +61 -61

353 lines not on this page · raw message

scsi/fdomain.c +1 -1
diff -purN drivers/scsi/fdomain.c drivers-fix/scsi/fdomain.c
@@ -1658,7 +1658,7 @@ static int fdomain_16x0_biosparam(struct
    } else if (bios_major == 3
 	      && bios_minor >= 0
 	      && bios_minor < 4) { /* 3.0 and 3.2 BIOS */
-      memcpy_fromio( &i, bios_base + 0x1f71 + drive * 10,
+      memcpy_fromio( &i, (void __iomem *)(bios_base + 0x1f71 + drive * 10),
 		     sizeof( struct drive_info ) );
       info_array[0] = i.heads + 1;
       info_array[1] = i.sectors;
scsi/ipr.c +34 -34

201 lines not on this page · raw message

scsi/megaraid/megaraid_mbox.h +4 -4
diff -purN drivers/scsi/megaraid/megaraid_mbox.h drivers-fix/scsi/megaraid/megaraid_mbox.h
@@ -258,10 +258,10 @@ typedef struct {
 #define IS_RAID_CH(rdev, ch)	(((rdev)->channel_class >> (ch)) & 0x01)
 
 
-#define RDINDOOR(rdev)		readl((rdev)->baseaddr + 0x20)
-#define RDOUTDOOR(rdev)		readl((rdev)->baseaddr + 0x2C)
-#define WRINDOOR(rdev, value)	writel(value, (rdev)->baseaddr + 0x20)
-#define WROUTDOOR(rdev, value)	writel(value, (rdev)->baseaddr + 0x2C)
+#define RDINDOOR(rdev)		readl((void __iomem *)((rdev)->baseaddr + 0x20))
+#define RDOUTDOOR(rdev)		readl((void __iomem *)((rdev)->baseaddr + 0x2C))
+#define WRINDOOR(rdev, value)	writel(value, (void __iomem *)((rdev)->baseaddr + 0x20))
+#define WROUTDOOR(rdev, value)	writel(value, (void __iomem *)((rdev)->baseaddr + 0x2C))
 
 #endif // _MEGARAID_H_
 
scsi/qlogicisp.c +2 -2
diff -purN drivers/scsi/qlogicisp.c drivers-fix/scsi/qlogicisp.c
@@ -629,7 +629,7 @@ static inline u_short isp_inw(struct Scs
 {
 	struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata;
 	if (h->memaddr)
-		return readw(h->memaddr + offset);
+		return readw((void __iomem *)(h->memaddr + offset));
 	else
 		return inw(host->io_port + offset);
 }
@@ -638,7 +638,7 @@ static inline void isp_outw(u_short val,
 {
 	struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata;
 	if (h->memaddr)
-		writew(val, h->memaddr + offset);
+		writew(val, (void __iomem *)(h->memaddr + offset));
 	else
 		outw(val, host->io_port + offset);
 }
scsi/sata_svw.c +18 -18
diff -purN drivers/scsi/sata_svw.c drivers-fix/scsi/sata_svw.c
@@ -103,26 +103,26 @@ 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);
+		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 +133,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;
scsi/sata_vsc.c +21 -21

76 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Ricky lloyd

attaching a patch diff'ed against 2.6.9-rc4. Fixes a whole bunch of compiler warnings of the
kind, "warning: passing arg 1 of `readl' makes pointer from integer without a cast"

Don't. You are just hiding the real problems that way.