* [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
* Re: [PATCH][2.4.28-pre3] MTD drivers gcc-3.4 fixes
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
0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2004-09-12 12:04 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: marcelo.tosatti, linux-kernel
On Sun, 2004-09-12 at 13:30 +0200, Mikael Pettersson wrote:
> 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.
Looks good; thanks.
Signed-Off-By: David Woodhouse <dwmw2@infradead.org>
Btw, please don't use that other email address for me unless it's ultra-
secret company business which really has to be sent unencrypted via
their STARTTLS-incapable mail servers instead of via my secure ones. I
suppose I should fix MAINTAINERS accordingly...
===== MAINTAINERS 1.145 vs edited =====
--- 1.145/MAINTAINERS 2004-08-28 10:18:52 +01:00
+++ edited/MAINTAINERS 2004-09-12 12:54:35 +01:00
@@ -1200,9 +1200,9 @@
MEMORY TECHNOLOGY DEVICES
P: David Woodhouse
-M: dwmw2@redhat.com
+M: dwmw2@infradead.org
W: http://www.linux-mtd.infradead.org/
-L: mtd@infradead.org
+L: linux-mtd@lists.infradead.org
S: Maintained
MICROTEK X6 SCANNER
--
dwmw2
^ 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;
as well as URLs for NNTP newsgroup(s).