mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.net>
To: barebox@lists.infradead.org
Cc: Grigory Milev <G.Milev@sam-solutions.com>,
	Dmitry Lavnikevich <D.Lavnikevich@sam-solutions.com>
Subject: [PATCH 2/5] mtd: Support for 4GB partitions
Date: Fri, 7 Mar 2014 14:14:55 +0300	[thread overview]
Message-ID: <5319AA2F.5070604@sam-solutions.net> (raw)
In-Reply-To: <1394190783-12978-1-git-send-email-d.lavnikevich@sam-solutions.com>

This patch implements correct way of creating partitions on mtd
devices with size >= 4GB.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
---
  commands/partition.c    | 4 ++--
  drivers/mtd/partition.c | 4 ++--
  include/linux/mtd/mtd.h | 4 ++--
  3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/commands/partition.c b/commands/partition.c
index f825722..44b91d1 100644
--- a/commands/partition.c
+++ b/commands/partition.c
@@ -59,11 +59,11 @@ static int mtd_part_do_parse_one(char *devname, 
const char *partstr,
  		size = SIZE_REMAINING;
  		end = (char *)partstr + 1;
  	} else {
-		size = strtoul_suffix(partstr, &end, 0);
+		size = strtoull_suffix(partstr, &end, 0);
  	}
   	if (*end == '@')
-		*offset = strtoul_suffix(end+1, &end, 0);
+		*offset = strtoull_suffix(end+1, &end, 0);
   	if (size == SIZE_REMAINING)
  		size = devsize - *offset;
diff --git a/drivers/mtd/partition.c b/drivers/mtd/partition.c
index 85f486d..1b8d36e 100644
--- a/drivers/mtd/partition.c
+++ b/drivers/mtd/partition.c
@@ -90,8 +90,8 @@ static int mtd_part_block_markbad(struct mtd_info 
*mtd, loff_t ofs)
  	return res;
  }
  -struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t 
offset, size_t size,
-		unsigned long flags, const char *name)
+struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset,
+		uint64_t size, unsigned long flags, const char *name)
  {
  	struct mtd_part *slave;
  	struct mtd_info *slave_mtd;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index d337455..165bc88 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -277,8 +277,8 @@ struct mtd_notifier {
  	struct list_head list;
  };
  -struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t 
offset, size_t size,
-		unsigned long flags, const char *name);
+struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset,
+		uint64_t size, unsigned long flags, const char *name);
  void mtd_del_partition(struct mtd_info *mtd);
   extern void register_mtd_user (struct mtd_notifier *new);
-- 
1.8.5.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

       reply	other threads:[~2014-03-07 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1394190783-12978-1-git-send-email-d.lavnikevich@sam-solutions.com>
2014-03-07 11:14 ` Dmitry Lavnikevich [this message]
2014-03-07 11:15 ` [PATCH 3/5] ubi: Fix for creating ubi volumes with 64bit size Dmitry Lavnikevich
2014-03-07 11:15 ` [PATCH 4/5] nand: mxs: Check for up to 4 NAND chips Dmitry Lavnikevich
2014-03-07 11:15 ` [PATCH 5/5] nand: mxs: Fix for calculating ecc strength on some types of NAND flash Dmitry Lavnikevich
2014-03-10 11:39 [PATCH 1/5] mtd: Update internal API to support 64-bit device size Dmitry Lavnikevich
2014-03-10 11:39 ` [PATCH 2/5] mtd: Support for 4GB partitions Dmitry Lavnikevich

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=5319AA2F.5070604@sam-solutions.net \
    --to=d.lavnikevich@sam-solutions.net \
    --cc=D.Lavnikevich@sam-solutions.com \
    --cc=G.Milev@sam-solutions.com \
    --cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox