diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2012-09-12 16:38:34 +0200 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-09-25 18:06:50 +0300 |
commit | f3f3a208048eac5f8b5752a17ebcd44db9230fd8 (patch) | |
tree | 2f697e448f84cf55ecaebcb19f6fc1b10d54e303 /flash_otp_write.c | |
parent | 4f1b10827b81cd9acaa9e02b0da0dc447f1471ea (diff) |
consistency between u_int32_t / off_t / off64_t
We should use the off_t type instead of off64_t or u_int32_t as its
length is controlled by the WITHOUT_LARGEFILE flag.
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'flash_otp_write.c')
-rw-r--r-- | flash_otp_write.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/flash_otp_write.c b/flash_otp_write.c index d407ebb..56769ec 100644 --- a/flash_otp_write.c +++ b/flash_otp_write.c @@ -13,6 +13,7 @@ #include <sys/types.h> #include <sys/ioctl.h> +#include <common.h> #include <mtd/mtd-user.h> int main(int argc,char *argv[]) @@ -47,7 +48,7 @@ int main(int argc,char *argv[]) return errno; } - offset = strtoul(argv[3], &p, 0); + offset = (off_t)strtoull(argv[3], &p, 0); if (argv[3][0] == 0 || *p != 0) { fprintf(stderr, "%s: bad offset value\n", PROGRAM_NAME); return ERANGE; @@ -58,7 +59,7 @@ int main(int argc,char *argv[]) return errno; } - printf("Writing OTP user data on %s at offset 0x%lx\n", argv[2], offset); + printf("Writing OTP user data on %s at offset 0x%"PRIxoff_t"\n", argv[2], offset); if (mtdInfo.type == MTD_NANDFLASH) len = mtdInfo.writesize; |