summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorDmitry Lavnikevich <d.lavnikevich@sam-solutions.com>2014-03-10 14:39:49 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2014-03-12 21:26:37 +0100
commit1ee640765a71a7b9ee2cf4ebad22ed5961aef8db (patch)
treeb41e5eefa1033297be8f1713fbcdacfa58e3aebc /commands
parentcf1b29a8504c83bb1922e249c2293a3ecd2920da (diff)
downloadbarebox-1ee640765a71a7b9ee2cf4ebad22ed5961aef8db.tar.gz
barebox-1ee640765a71a7b9ee2cf4ebad22ed5961aef8db.tar.xz
mtd: Update internal API to support 64-bit device size
MTD internal API presently uses 32-bit values to represent device size. This patch updates them to 64-bits but leaves the external API unchanged. In general, changing from 32-bit to 64-bit values cause little or no changes to the majority of the code with the following exceptions: - printk message formats; - division and modulus of 64-bit values (mtd_div_by_wb, mtd_div_by_eb may be used in some of such cases). Was tested on phyFLEX i.MX6. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/nandtest.c2
-rw-r--r--commands/partition.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/commands/nandtest.c b/commands/nandtest.c
index 0da5444c02..c64f2443a8 100644
--- a/commands/nandtest.c
+++ b/commands/nandtest.c
@@ -277,7 +277,7 @@ static int do_nandtest(int argc, char *argv[])
}
if (length + flash_offset > meminfo.size) {
printf("Length 0x%08llx + offset 0x%08llx exceeds "
- "device size 0x%08x\n", length,
+ "device size 0x%08llx\n", length,
flash_offset, meminfo.size);
goto err;
}
diff --git a/commands/partition.c b/commands/partition.c
index 6d37471f4f..f8257222a9 100644
--- a/commands/partition.c
+++ b/commands/partition.c
@@ -42,10 +42,11 @@
#define PART_ADD_DEVNAME (1 << 0)
static int mtd_part_do_parse_one(char *devname, const char *partstr,
- char **endp, unsigned long *offset,
- off_t devsize, size_t *retsize, unsigned int pflags)
+ char **endp, loff_t *offset,
+ loff_t devsize, size_t *retsize,
+ unsigned int pflags)
{
- ulong size;
+ loff_t size;
char *end;
char buf[PATH_MAX] = {};
unsigned long flags = 0;
@@ -114,8 +115,8 @@ static int do_addpart(int argc, char *argv[])
{
char *devname;
char *endp;
- unsigned long offset = 0;
- off_t devsize;
+ loff_t offset = 0;
+ loff_t devsize;
struct stat s;
int opt;
unsigned int flags = PART_ADD_DEVNAME;