diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2007-02-12 18:34:07 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2007-02-12 18:34:07 +0000 |
commit | 474883fbc33df9784812e4ccd669d48b0cfd75ce (patch) | |
tree | d5f0615f447389170cbf48954f9a614815e2e000 /packages/obsolete/nslu2/nslu2-kernel/2.6.14/10-ixp4xx-copy-from.patch | |
parent | 761bfdca711fcfd38a1be2f15119ec3a6a0d63ee (diff) | |
parent | d0e9d51dbd5fc3bf911861a3349a13b84aa7b97a (diff) |
merge of '5ff0c6a73c856c171a050f6f6bc0df2ce24137b2'
and 'f3780bcc3524d0bdc5a415852de6fa66fc3526ba'
Diffstat (limited to 'packages/obsolete/nslu2/nslu2-kernel/2.6.14/10-ixp4xx-copy-from.patch')
-rw-r--r-- | packages/obsolete/nslu2/nslu2-kernel/2.6.14/10-ixp4xx-copy-from.patch | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/packages/obsolete/nslu2/nslu2-kernel/2.6.14/10-ixp4xx-copy-from.patch b/packages/obsolete/nslu2/nslu2-kernel/2.6.14/10-ixp4xx-copy-from.patch deleted file mode 100644 index f3da2e093f..0000000000 --- a/packages/obsolete/nslu2/nslu2-kernel/2.6.14/10-ixp4xx-copy-from.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- linux-2.6.14/drivers/mtd/maps/ixp4xx.c 2005-10-27 17:02:08.000000000 -0700 -+++ linux-2.6.14/drivers/mtd/maps/ixp4xx.c 2005-10-29 23:11:24.990820968 -0700 -@@ -38,10 +38,14 @@ - #define BYTE1(h) ((h) & 0xFF) - #endif - -+#define FLASHWORD(a) (*(__u16*)(a)) -+#define FLASHVAL(a) FLASHWORD(a) -+#define FLASHSET(a,v) do { FLASHWORD(a) = (v); } while (0) -+ - static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) - { - map_word val; -- val.x[0] = *(__u16 *) (map->map_priv_1 + ofs); -+ val.x[0] = FLASHVAL(map->map_priv_1 + ofs); - return val; - } - -@@ -53,19 +57,25 @@ static map_word ixp4xx_read16(struct map - static void ixp4xx_copy_from(struct map_info *map, void *to, - unsigned long from, ssize_t len) - { -- int i; -- u8 *dest = (u8 *) to; -- u16 *src = (u16 *) (map->map_priv_1 + from); -- u16 data; -- -- for (i = 0; i < (len / 2); i++) { -- data = src[i]; -- dest[i * 2] = BYTE0(data); -- dest[i * 2 + 1] = BYTE1(data); -+ u8 *dest, *src; -+ -+ if (len <= 0) -+ return; -+ -+ dest = (u8 *) to; -+ src = (u8 *) (map->map_priv_1 + from); -+ if (from & 1) -+ *dest++ = BYTE1(FLASHVAL(src-1)), ++src, --len; -+ -+ while (len >= 2) { -+ u16 data = FLASHVAL(src); src += 2; -+ *dest++ = BYTE0(data); -+ *dest++ = BYTE1(data); -+ len -= 2; - } - -- if (len & 1) -- dest[len - 1] = BYTE0(src[i]); -+ if (len > 0) -+ *dest++ = BYTE0(FLASHVAL(src)); - } - - /* -@@ -75,7 +85,7 @@ static void ixp4xx_copy_from(struct map_ - static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) - { - if (!(adr & 1)) -- *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; -+ FLASHSET(map->map_priv_1 + adr, d.x[0]); - } - - /* -@@ -83,7 +93,7 @@ static void ixp4xx_probe_write16(struct - */ - static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) - { -- *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; -+ FLASHSET(map->map_priv_1 + adr, d.x[0]); - } - - struct ixp4xx_flash_info { |