Skip to content

Commit

Permalink
mtd: bcm63xxpart: merge sparelen calculation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonas Gorski authored and Artem Bityutskiy committed Nov 21, 2012
1 parent fafc3d6 commit e190401
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mtd/bcm63xxpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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)
Expand Down

0 comments on commit e190401

Please sign in to comment.