Commit 8c6d5497 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] gcc-3.5: mtd

drivers/mtd/chips/cfi_cmdset_0020.c:545: error: invalid lvalue in increment
drivers/mtd/chips/cfi_cmdset_0020.c:547: error: invalid lvalue in increment
drivers/mtd/chips/cfi_cmdset_0020.c:549: error: invalid lvalue in increment
parent 389092fb
......@@ -1003,13 +1003,25 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
z = 0;
while(z < words * CFIDEV_BUSWIDTH) {
if (cfi_buswidth_is_1()) {
map_write8 (map, *((__u8*)buf)++, adr+z);
u8 *b = (u8 *)buf;
map_write8 (map, *b++, adr+z);
buf = (const u_char *)b;
} else if (cfi_buswidth_is_2()) {
map_write16 (map, *((__u16*)buf)++, adr+z);
u16 *b = (u16 *)buf;
map_write16 (map, *b++, adr+z);
buf = (const u_char *)b;
} else if (cfi_buswidth_is_4()) {
map_write32 (map, *((__u32*)buf)++, adr+z);
u32 *b = (u32 *)buf;
map_write32 (map, *b++, adr+z);
buf = (const u_char *)b;
} else if (cfi_buswidth_is_8()) {
map_write64 (map, *((__u64*)buf)++, adr+z);
u64 *b = (u64 *)buf;
map_write64 (map, *b++, adr+z);
buf = (const u_char *)b;
} else {
ret = -EINVAL;
goto out;
......@@ -1025,11 +1037,20 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
while (i < CFIDEV_BUSWIDTH)
tmp_buf[i++] = 0xff;
if (cfi_buswidth_is_2()) {
map_write16 (map, *((__u16*)tmp_p)++, adr+z);
u16 *b = (u16 *)tmp_p;
map_write16 (map, *b++, adr+z);
tmp_p = (u_char *)b;
} else if (cfi_buswidth_is_4()) {
map_write32 (map, *((__u32*)tmp_p)++, adr+z);
u32 *b = (u32 *)tmp_p;
map_write32 (map, *b++, adr+z);
tmp_p = (u_char *)b;
} else if (cfi_buswidth_is_8()) {
map_write64 (map, *((__u64*)tmp_p)++, adr+z);
u64 *b = (u64 *)tmp_p;
map_write64 (map, *b++, adr+z);
tmp_p = (u_char *)b;
} else {
ret = -EINVAL;
goto out;
......
......@@ -542,11 +542,20 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
/* Write data */
for (z = 0; z < len; z += CFIDEV_BUSWIDTH) {
if (cfi_buswidth_is_1()) {
map_write8 (map, *((__u8*)buf)++, adr+z);
u8 *b = (u8 *)buf;
map_write8 (map, *b++, adr+z);
buf = (const u_char *)b;
} else if (cfi_buswidth_is_2()) {
map_write16 (map, *((__u16*)buf)++, adr+z);
u16 *b = (u16 *)buf;
map_write16 (map, *b++, adr+z);
buf = (const u_char *)b;
} else if (cfi_buswidth_is_4()) {
map_write32 (map, *((__u32*)buf)++, adr+z);
u32 *b = (u32 *)buf;
map_write32 (map, *b++, adr+z);
buf = (const u_char *)b;
} else {
DISABLE_VPP(map);
return -EINVAL;
......
......@@ -148,7 +148,7 @@ static void elan_104nc_copy_from(struct map_info *map, void *to, unsigned long f
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;
}
......
......@@ -155,7 +155,7 @@ static void sbc_gxx_copy_from(struct map_info *map, void *to, unsigned long from
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment