diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-18 13:38:02 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-18 13:38:02 +0200 |
commit | 6022deaa5b3b46926757d90fedb8835718150763 (patch) | |
tree | b07f22d183d943fe0a5859d0721a6bb08472ff12 /nanddump.c | |
parent | 5efcdf7a2bfafd01e5c6d53dd46335f30704b2ad (diff) |
nanddump: fail if -s parameter is unaligned
Implement the feature which we planned long time ago - make nanddump
fail if the -s parameter is not NAND page-aligned. Also bump nanddump
version.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'nanddump.c')
-rw-r--r-- | nanddump.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -14,7 +14,7 @@ */ #define PROGRAM_NAME "nanddump" -#define VERSION "$Revision: 1.29 $" +#define VERSION "1.30" #define _GNU_SOURCE #include <ctype.h> @@ -366,11 +366,10 @@ int main(int argc, char * const argv[]) /* Initialize start/end addresses and block size */ if (start_addr & (mtd.min_io_size - 1)) { - fprintf(stderr, "WARNING: The start address is not page-aligned !\n" - "The pagesize of this NAND Flash is 0x%x.\n" - "nandwrite doesn't allow writes starting at this location.\n" - "Future versions of nanddump will fail here.\n", + fprintf(stderr, "the start address (-s parameter) is not page-aligned!\n" + "The pagesize of this NAND Flash is 0x%x.\n", mtd.min_io_size); + goto closeall; } if (length) end_addr = start_addr + length; |