All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Gorski <jonas.gorski@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Artem Bityutskiy <Artem.Bityutskiy@intel.com>
Subject: [PATCH 3/5] MTD: bcm63xxpart: don't assume NVRAM is always the fourth partition
Date: Sat, 17 Dec 2011 13:58:16 +0100	[thread overview]
Message-ID: <1324126698-9919-4-git-send-email-jonas.gorski@gmail.com> (raw)
In-Reply-To: <1324126698-9919-1-git-send-email-jonas.gorski@gmail.com>

Instead of referencing the sizes of fixed partitions, use the
precomputed CFE/NVRAM lengths.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/mtd/bcm63xxpart.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c
index 23f6201..3becb4d 100644
--- a/drivers/mtd/bcm63xxpart.c
+++ b/drivers/mtd/bcm63xxpart.c
@@ -165,8 +165,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
 	/* Global partition "linux" to make easy firmware upgrade */
 	curpart++;
 	parts[curpart].name = "linux";
-	parts[curpart].offset = parts[0].size;
-	parts[curpart].size = master->size - parts[0].size - parts[3].size;
+	parts[curpart].offset = cfelen;
+	parts[curpart].size = master->size - cfelen - nvramlen;
 
 	for (i = 0; i < nrparts; i++)
 		pr_info("Partition %d is %s offset %lx and length %lx\n", i,
-- 
1.7.2.5

WARNING: multiple messages have this Message-ID (diff)
From: Jonas Gorski <jonas.gorski@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: linux-mips@linux-mips.org,
	Artem Bityutskiy <Artem.Bityutskiy@intel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Florian Fainelli <florian@openwrt.org>
Subject: [PATCH 3/5] MTD: bcm63xxpart: don't assume NVRAM is always the fourth partition
Date: Sat, 17 Dec 2011 13:58:16 +0100	[thread overview]
Message-ID: <1324126698-9919-4-git-send-email-jonas.gorski@gmail.com> (raw)
In-Reply-To: <1324126698-9919-1-git-send-email-jonas.gorski@gmail.com>

Instead of referencing the sizes of fixed partitions, use the
precomputed CFE/NVRAM lengths.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/mtd/bcm63xxpart.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c
index 23f6201..3becb4d 100644
--- a/drivers/mtd/bcm63xxpart.c
+++ b/drivers/mtd/bcm63xxpart.c
@@ -165,8 +165,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
 	/* Global partition "linux" to make easy firmware upgrade */
 	curpart++;
 	parts[curpart].name = "linux";
-	parts[curpart].offset = parts[0].size;
-	parts[curpart].size = master->size - parts[0].size - parts[3].size;
+	parts[curpart].offset = cfelen;
+	parts[curpart].size = master->size - cfelen - nvramlen;
 
 	for (i = 0; i < nrparts; i++)
 		pr_info("Partition %d is %s offset %lx and length %lx\n", i,
-- 
1.7.2.5

  parent reply	other threads:[~2011-12-17 13:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 12:58 [PATCH 0/5] MTD: bcm63xxpart: improve robustness Jonas Gorski
2011-12-17 12:58 ` Jonas Gorski
2011-12-17 12:58 ` [PATCH 1/5] MTD: bcm63xxpart: check version marker string for newer CFEs Jonas Gorski
2011-12-17 12:58   ` Jonas Gorski
2011-12-17 12:58 ` [PATCH 2/5] MTD: bcm63xxpart: make sure CFE and NVRAM partitions are at least 64K Jonas Gorski
2011-12-17 12:58   ` Jonas Gorski
2011-12-17 13:13   ` Guillaume LECERF
2011-12-17 13:13     ` Guillaume LECERF
2011-12-17 13:27     ` Jonas Gorski
2011-12-17 13:27       ` Jonas Gorski
2011-12-17 14:32       ` Guillaume LECERF
2011-12-17 14:32         ` Guillaume LECERF
2011-12-17 21:33   ` Artem Bityutskiy
2011-12-17 21:33     ` Artem Bityutskiy
2011-12-17 21:57     ` Jonas Gorski
2011-12-17 21:57       ` Jonas Gorski
2011-12-18 11:47       ` Artem Bityutskiy
2011-12-18 11:47         ` Artem Bityutskiy
2011-12-19 10:36         ` [PATCH V2 " Jonas Gorski
2011-12-19 10:36           ` Jonas Gorski
2011-12-19 10:56           ` Artem Bityutskiy
2011-12-19 10:56             ` Artem Bityutskiy
2011-12-19 12:01             ` Jonas Gorski
2011-12-19 12:01               ` Jonas Gorski
2011-12-21 20:54           ` Artem Bityutskiy
2011-12-21 20:54             ` Artem Bityutskiy
2011-12-17 12:58 ` Jonas Gorski [this message]
2011-12-17 12:58   ` [PATCH 3/5] MTD: bcm63xxpart: don't assume NVRAM is always the fourth partition Jonas Gorski
2011-12-17 12:58 ` [PATCH 4/5] MIPS: BCM63XX: bcm963xx_tag.h: make crc fields integers Jonas Gorski
2011-12-17 12:58   ` Jonas Gorski
2011-12-17 12:58 ` [PATCH 5/5] MTD: bcm63xxpart: check the image tag's crc32 Jonas Gorski
2011-12-17 12:58   ` Jonas Gorski
2011-12-17 21:40 ` [PATCH 0/5] MTD: bcm63xxpart: improve robustness Artem Bityutskiy
2011-12-17 21:40   ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324126698-9919-4-git-send-email-jonas.gorski@gmail.com \
    --to=jonas.gorski@gmail.com \
    --cc=Artem.Bityutskiy@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.