[PATCH 1/2] mtd-utils: more style fixups
Brian Norris
computersforpeace at gmail.com
Wed Oct 20 02:45:24 EDT 2010
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
nanddump.c | 7 +++----
nandwrite.c | 6 +++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/nanddump.c b/nanddump.c
index bb649da..6428bc4 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -308,7 +308,7 @@ int main(int argc, char * const argv[])
oob.ptr = oobbuf;
if (noecc) {
- ret = ioctl(fd, MTDFILEMODE, (void *) MTD_MODE_RAW);
+ ret = ioctl(fd, MTDFILEMODE, (void *)MTD_MODE_RAW);
if (ret == 0) {
oobinfochanged = 2;
} else {
@@ -330,7 +330,6 @@ int main(int argc, char * const argv[])
}
}
} else {
-
/* check if we can read ecc stats */
if (!ioctl(fd, ECCGETSTATS, &stat1)) {
eccstats = true;
@@ -375,7 +374,6 @@ int main(int argc, char * const argv[])
bs = meminfo.writesize;
/* Print informative message */
-
if (!quiet) {
fprintf(stderr, "Block size %u, page size %u, OOB size %u\n",
meminfo.erasesize, meminfo.writesize, meminfo.oobsize);
@@ -383,6 +381,7 @@ int main(int argc, char * const argv[])
"Dumping data starting at 0x%08x and ending at 0x%08x...\n",
(unsigned int)start_addr, (unsigned int)end_addr);
}
+
/* Dump the flash contents */
for (ofs = start_addr; ofs < end_addr; ofs += bs) {
/* Check for bad block */
@@ -401,7 +400,7 @@ int main(int argc, char * const argv[])
if (badblock) {
if (omitbad)
continue;
- memset (readbuf, 0xff, bs);
+ memset(readbuf, 0xff, bs);
} else {
/* Read page data and exit on failure */
if (pread(fd, readbuf, bs, ofs) != bs) {
diff --git a/nandwrite.c b/nandwrite.c
index b5745b9..fe03115 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -592,14 +592,14 @@ int main(int argc, char * const argv[])
int i, start, len;
int tags_pos = 0;
/*
- * We use autoplacement and have the oobinfo with the autoplacement
+ * We use autoplacement and have the oobinfo with the autoplacement
* information from the kernel available
*
* Modified to support out of order oobfree segments,
* such as the layout used by diskonchip.c
*/
if (!oobinfochanged && (old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE)) {
- for (i = 0;old_oobinfo.oobfree[i][1]; i++) {
+ for (i = 0; old_oobinfo.oobfree[i][1]; i++) {
/* Set the reserved bytes to 0xff */
start = old_oobinfo.oobfree[i][0];
len = old_oobinfo.oobfree[i][1];
@@ -620,7 +620,7 @@ int main(int argc, char * const argv[])
len);
}
}
- /* Write OOB data first, as ecc will be placed in there*/
+ /* Write OOB data first, as ecc will be placed in there */
oob.start = mtdoffset;
if (ioctl(fd, MEMWRITEOOB, &oob) != 0) {
perror("ioctl(MEMWRITEOOB)");
--
1.7.0.4
More information about the linux-mtd
mailing list