aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-03-31 09:01:10 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-03-31 09:01:10 +0000
commite8fc01d20cc73765ccd6d0d15364b6043153a9bf (patch)
tree4416b57ee9c94bcc5e1a8f1599e8702d405647e5 /target
parentbee15dddc829beef522a901e1eea1af6d06c3de0 (diff)
downloadmaster-187ad058-e8fc01d20cc73765ccd6d0d15364b6043153a9bf.tar.gz
master-187ad058-e8fc01d20cc73765ccd6d0d15364b6043153a9bf.tar.bz2
master-187ad058-e8fc01d20cc73765ccd6d0d15364b6043153a9bf.zip
Fix the division by zero (sn9)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6770 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/rdc-2.6/files/drivers/mtd/maps/rdc3210.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/target/linux/rdc-2.6/files/drivers/mtd/maps/rdc3210.c b/target/linux/rdc-2.6/files/drivers/mtd/maps/rdc3210.c
index 7a8193f023..f6a634a9ca 100644
--- a/target/linux/rdc-2.6/files/drivers/mtd/maps/rdc3210.c
+++ b/target/linux/rdc-2.6/files/drivers/mtd/maps/rdc3210.c
@@ -18,8 +18,8 @@
#ifndef RDC3210_STATIC_MAP
#define RDC3210_STATIC_MAP 0
#endif
-#ifndef RDC3210_NO_FACTORY_DFLT
-#define RDC3210_NO_FACTORY_DFLT 1
+#ifndef RDC3210_FACTORY_DFLT
+#define RDC3210_FACTORY_DFLT 0
#endif
#ifndef RDC3210_USING_JFFS2
#define RDC3210_USING_JFFS2 1
@@ -121,7 +121,7 @@ static struct mtd_partition rdc3210_parts[] =
{ name: "linux", offset: 0, size: 0x003C0000 }, /* 3840 KB = (Kernel + ROMFS) = (768 KB + 3072 KB) */
{ name: "romfs", offset: 0x000C0000, size: 0x00300000 }, /* 3072 KB */
{ name: "nvram", offset: 0x003C0000, size: 0x00010000 }, /* 64 KB */
-#if RDC3210_STATIC_MAP || !RDC3210_NO_FACTORY_DFLT
+#if RDC3210_STATIC_MAP || RDC3210_FACTORY_DFLT
{ name: "factory", offset: 0x003D0000, size: 0x00010000 }, /* 64 KB */
#endif
{ name: "bootldr", offset: 0x003E0000, size: 0x00020000 }, /* 128 KB */
@@ -173,6 +173,7 @@ mod_init_t init_rdc3210_map(void)
return -EIO;
}
+#if RDC3210_FACTORY_DFLT
/* 1. Adjust Redboot */
tmp = flashdrv_get_size() - rdc3210_parts[4].size;
rdc3210_parts[4].offset = flashdrv_get_sector_addr(flashdrv_get_sector(tmp));
@@ -195,7 +196,7 @@ mod_init_t init_rdc3210_map(void)
tmp = hdr->kernelsz + sizeof(gt_imghdr_t);
rdc3210_parts[1].offset = rdc3210_parts[0].offset + (((tmp / tmp2) + ((tmp % tmp2) ? 1 : 0)) * tmp2);
rdc3210_parts[1].size = rdc3210_parts[2].offset - rdc3210_parts[1].offset;
-#if RDC3210_NO_FACTORY_DFLT
+#else
/* 1. Adjust Redboot */
tmp = flashdrv_get_size() - rdc3210_parts[3].size;
rdc3210_parts[3].offset = flashdrv_get_sector_addr(flashdrv_get_sector(tmp));