summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/bcm63xxpart.c
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2012-11-12 10:52:48 +0100
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-11-21 17:15:05 +0200
commite190401ba1ca20d76f22c1f0aada0abd5bdc1afe (patch)
treeb0d435af8591e96b404e44ae018bf97fd709a737 /drivers/mtd/bcm63xxpart.c
parentfafc3d6880b28fe55af935fd43b23a29d61c537d (diff)
downloadlinux-e190401ba1ca20d76f22c1f0aada0abd5bdc1afe.tar.bz2
mtd: bcm63xxpart: merge sparelen calculation
The length of the spare part is calculated the same way in both branches so move to a common place. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/bcm63xxpart.c')
-rw-r--r--drivers/mtd/bcm63xxpart.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c
index 1eb1416404a6..ba7eeb874b31 100644
--- a/drivers/mtd/bcm63xxpart.c
+++ b/drivers/mtd/bcm63xxpart.c
@@ -120,7 +120,6 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE;
rootfsaddr = rootfsaddr - BCM63XX_EXTENDED_SIZE;
spareaddr = roundup(totallen, master->erasesize) + cfelen;
- sparelen = master->size - spareaddr - nvramlen;
if (rootfsaddr < kerneladdr) {
/* default Broadcom layout */
@@ -138,8 +137,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
rootfslen = 0;
rootfsaddr = 0;
spareaddr = cfelen;
- sparelen = master->size - cfelen - nvramlen;
}
+ sparelen = master->size - spareaddr - nvramlen;
/* Determine number of partitions */
if (rootfslen > 0)