diff options
Diffstat (limited to 'nandtest.c')
-rw-r--r-- | nandtest.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -79,7 +79,7 @@ int erase_and_write(loff_t ofs, unsigned char *data, unsigned char *rbuf) printf("\r%08x: reading...", (unsigned)ofs); fflush(stdout); - + len = pread(fd, rbuf, meminfo.erasesize, ofs); if (len < meminfo.erasesize) { printf("\n"); @@ -89,7 +89,7 @@ int erase_and_write(loff_t ofs, unsigned char *data, unsigned char *rbuf) perror("read"); exit(1); } - + if (ioctl(fd, ECCGETSTATS, &newstats)) { printf("\n"); perror("ECCGETSTATS"); @@ -184,7 +184,7 @@ int main(int argc, char **argv) case 'l': length = strtol(optarg, NULL, 0); break; - + } } if (argc - optind != 1) @@ -195,7 +195,7 @@ int main(int argc, char **argv) perror("open"); exit(1); } - + if (ioctl(fd, MEMGETINFO, &meminfo)) { perror("MEMGETINFO"); close(fd); @@ -206,20 +206,20 @@ int main(int argc, char **argv) length = meminfo.size; if (offset % meminfo.erasesize) { - fprintf(stderr, "Offset %x not multiple of erase size %x\n", + fprintf(stderr, "Offset %x not multiple of erase size %x\n", offset, meminfo.erasesize); exit(1); } if (length % meminfo.erasesize) { - fprintf(stderr, "Length %x not multiple of erase size %x\n", + fprintf(stderr, "Length %x not multiple of erase size %x\n", length, meminfo.erasesize); exit(1); } if (length + offset > meminfo.size) { - fprintf(stderr, "Length %x + offset %x exceeds device size %x\n", + fprintf(stderr, "Length %x + offset %x exceeds device size %x\n", length, offset, meminfo.size); exit(1); - } + } wbuf = malloc(meminfo.erasesize * 3); if (!wbuf) { |