From 59b4ceaa65902ff2dcf13d12fb4ef97ea3ad8cec Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 29 Nov 2010 00:01:58 -0800 Subject: nanddump: change "unsigned" to "signed" For consistency between nanddump and nandwrite and in order to provide better means for checking for negative inputs, the "offset" and "length" types in nanddump should be changed to signed integer types. This also solves a signed/unsigned comparison warning. Signed-off-by: Brian Norris Signed-off-by: Artem Bityutskiy --- nanddump.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nanddump.c b/nanddump.c index 14a8816..b0dd7dc 100644 --- a/nanddump.c +++ b/nanddump.c @@ -82,8 +82,8 @@ static bool pretty_print = false; // print nice static bool noecc = false; // don't error correct static bool noskipbad = false; // don't skip bad blocks static bool omitoob = false; // omit oob data -static unsigned long long start_addr; // start address -static unsigned long long length; // dump length +static long long start_addr; // start address +static long long length; // dump length static const char *mtddev; // mtd device name static const char *dumpfile; // dump file name static bool omitbad = false; @@ -136,7 +136,7 @@ static void process_options(int argc, char * const argv[]) omitbad = true; break; case 's': - start_addr = simple_strtoull(optarg, &error); + start_addr = simple_strtoll(optarg, &error); break; case 'f': if (!(dumpfile = strdup(optarg))) { @@ -145,7 +145,7 @@ static void process_options(int argc, char * const argv[]) } break; case 'l': - length = simple_strtoull(optarg, &error); + length = simple_strtoll(optarg, &error); break; case 'o': omitoob = true; @@ -273,8 +273,8 @@ nil: */ int main(int argc, char * const argv[]) { - unsigned long long ofs, end_addr = 0; - unsigned long long blockstart = 1; + long long ofs, end_addr = 0; + long long blockstart = 1; int ret, i, fd, ofd = 0, bs, badblock = 0; struct mtd_dev_info mtd; char pretty_buf[PRETTY_BUF_LEN]; -- cgit v1.2.3