From: Jonas Gorski Date: Mon, 12 Nov 2012 09:52:48 +0000 (+0100) Subject: mtd: bcm63xxpart: merge sparelen calculation X-Git-Tag: v3.8-rc1~47^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e190401ba1ca20d76f22c1f0aada0abd5bdc1afe;p=platform%2Fkernel%2Flinux-stable.git 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 Reviewed-by: Florian Fainelli Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c index 1eb1416..ba7eeb8 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)