mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.4.28-pre3] MTD drivers gcc-3.4 fixes
@ 2004-09-12 11:30 Mikael Pettersson
  2004-09-12 12:04 ` David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2004-09-12 11:30 UTC (permalink / raw)
  To: dwmw2, marcelo.tosatti; +Cc: linux-kernel

This patch fixes gcc-3.4 cast-as-lvalue warnings in the 2.4.28-pre3
kernel's MTD drivers. The elan-104nc.c and sbc_gxx.c changes are
backports from the 2.6 kernel. The cfi_cmdset_0001.c and cfi_cmdset_0020.c
changes are new since the 2.6 code is different.

/Mikael

--- linux-2.4.28-pre3/drivers/mtd/chips/cfi_cmdset_0001.c.~1~	2003-06-14 13:30:22.000000000 +0200
+++ linux-2.4.28-pre3/drivers/mtd/chips/cfi_cmdset_0001.c	2004-09-12 01:56:20.000000000 +0200
@@ -1201,13 +1201,17 @@
 	/* Write data */
 	for (z = 0; z < len; z += CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
-			map->write8 (map, *((__u8*)buf)++, adr+z);
+			map->write8 (map, *(__u8*)buf, adr+z);
+			buf += sizeof(__u8);
 		} else if (cfi_buswidth_is_2()) {
-			map->write16 (map, *((__u16*)buf)++, adr+z);
+			map->write16 (map, *(__u16*)buf, adr+z);
+			buf += sizeof(__u16);
 		} else if (cfi_buswidth_is_4()) {
-			map->write32 (map, *((__u32*)buf)++, adr+z);
+			map->write32 (map, *(__u32*)buf, adr+z);
+			buf += sizeof(__u32);
 		} else if (cfi_buswidth_is_8()) {
-			map->write64 (map, *((__u64*)buf)++, adr+z);
+			map->write64 (map, *(__u64*)buf, adr+z);
+			buf += sizeof(__u64);
 		} else {
 			DISABLE_VPP(map);
 			ret = -EINVAL;
--- linux-2.4.28-pre3/drivers/mtd/chips/cfi_cmdset_0020.c.~1~	2003-06-14 13:30:22.000000000 +0200
+++ linux-2.4.28-pre3/drivers/mtd/chips/cfi_cmdset_0020.c	2004-09-12 01:56:20.000000000 +0200
@@ -540,11 +540,14 @@
 	/* Write data */
 	for (z = 0; z < len; z += CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
-			map->write8 (map, *((__u8*)buf)++, adr+z);
+			map->write8 (map, *(__u8*)buf, adr+z);
+			buf += sizeof(__u8);
 		} else if (cfi_buswidth_is_2()) {
-			map->write16 (map, *((__u16*)buf)++, adr+z);
+			map->write16 (map, *(__u16*)buf, adr+z);
+			buf += sizeof(__u16);
 		} else if (cfi_buswidth_is_4()) {
-			map->write32 (map, *((__u32*)buf)++, adr+z);
+			map->write32 (map, *(__u32*)buf, adr+z);
+			buf += sizeof(__u32);
 		} else {
 			DISABLE_VPP(map);
 			return -EINVAL;
--- linux-2.4.28-pre3/drivers/mtd/maps/elan-104nc.c.~1~	2002-08-07 00:52:20.000000000 +0200
+++ linux-2.4.28-pre3/drivers/mtd/maps/elan-104nc.c	2004-09-12 01:56:20.000000000 +0200
@@ -147,7 +147,7 @@
 		elan_104nc_page(map, from);
 		memcpy_fromio(to, iomapadr + (from & WINDOW_MASK), thislen);
 		spin_unlock(&elan_104nc_spin);
-		(__u8*)to += thislen;
+		to += thislen;
 		from += thislen;
 		len -= thislen;
 	}
--- linux-2.4.28-pre3/drivers/mtd/maps/sbc_gxx.c.~1~	2003-06-14 13:30:22.000000000 +0200
+++ linux-2.4.28-pre3/drivers/mtd/maps/sbc_gxx.c	2004-09-12 01:56:20.000000000 +0200
@@ -155,7 +155,7 @@
 		sbc_gxx_page(map, from);
 		memcpy_fromio(to, iomapadr + (from & WINDOW_MASK), thislen);
 		spin_unlock(&sbc_gxx_spin);
-		(__u8*)to += thislen;
+		to += thislen;
 		from += thislen;
 		len -= thislen;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-12 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-12 11:30 [PATCH][2.4.28-pre3] MTD drivers gcc-3.4 fixes Mikael Pettersson
2004-09-12 12:04 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®