diff options
author | Ron Yorston <rmy@pobox.com> | 2012-12-11 13:54:18 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-12-11 13:54:18 +0000 |
commit | af379094877a07180919b57af8df8d4f580967ab (patch) | |
tree | b33428d37e8e76b08330dd8fb099b647f7dd83cf /miscutils | |
parent | 494dc899fd1b3b5fbac1c47bc5a604aed99654c8 (diff) | |
parent | 4d5955e9ece64e273e72c303983199be73022fab (diff) | |
download | busybox-w32-af379094877a07180919b57af8df8d4f580967ab.tar.gz busybox-w32-af379094877a07180919b57af8df8d4f580967ab.tar.bz2 busybox-w32-af379094877a07180919b57af8df8d4f580967ab.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/fbsplash.c | 5 | ||||
-rw-r--r-- | miscutils/nandwrite.c | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 37ca66559..05a77da23 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c | |||
@@ -312,8 +312,7 @@ static void fb_drawprogressbar(unsigned percent) | |||
312 | 312 | ||
313 | pos_x = left_x; | 313 | pos_x = left_x; |
314 | if (percent > 0) { | 314 | if (percent > 0) { |
315 | int y; | 315 | int i, y; |
316 | unsigned i; | ||
317 | 316 | ||
318 | // actual progress bar | 317 | // actual progress bar |
319 | pos_x += (unsigned)(width * percent) / 100; | 318 | pos_x += (unsigned)(width * percent) / 100; |
@@ -325,7 +324,7 @@ static void fb_drawprogressbar(unsigned percent) | |||
325 | while (i >= 0) { | 324 | while (i >= 0) { |
326 | // draw one-line thick "rectangle" | 325 | // draw one-line thick "rectangle" |
327 | // top line will have gray lvl 200, bottom one 100 | 326 | // top line will have gray lvl 200, bottom one 100 |
328 | unsigned gray_level = 100 + i*100 / height; | 327 | unsigned gray_level = 100 + (unsigned)i*100 / height; |
329 | fb_drawfullrectangle( | 328 | fb_drawfullrectangle( |
330 | left_x, y, pos_x, y, | 329 | left_x, y, pos_x, y, |
331 | gray_level, gray_level, gray_level); | 330 | gray_level, gray_level, gray_level); |
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c index c636a5aa2..5908ac773 100644 --- a/miscutils/nandwrite.c +++ b/miscutils/nandwrite.c | |||
@@ -39,7 +39,7 @@ | |||
39 | //usage: "[-o] [-b] [-s ADDR] [-f FILE] MTD_DEVICE" | 39 | //usage: "[-o] [-b] [-s ADDR] [-f FILE] MTD_DEVICE" |
40 | //usage:#define nanddump_full_usage "\n\n" | 40 | //usage:#define nanddump_full_usage "\n\n" |
41 | //usage: "Dump the specified MTD device\n" | 41 | //usage: "Dump the specified MTD device\n" |
42 | //usage: "\n -o Omit oob data" | 42 | //usage: "\n -o Dump oob data" |
43 | //usage: "\n -b Omit bad block from the dump" | 43 | //usage: "\n -b Omit bad block from the dump" |
44 | //usage: "\n -s ADDR Start address" | 44 | //usage: "\n -s ADDR Start address" |
45 | //usage: "\n -l LEN Length" | 45 | //usage: "\n -l LEN Length" |
@@ -162,9 +162,9 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv) | |||
162 | tmp = next_good_eraseblock(fd, &meminfo, blockstart); | 162 | tmp = next_good_eraseblock(fd, &meminfo, blockstart); |
163 | if (tmp != blockstart) { | 163 | if (tmp != blockstart) { |
164 | /* bad block(s), advance mtdoffset */ | 164 | /* bad block(s), advance mtdoffset */ |
165 | if (IS_NANDDUMP & !(opts & OPT_b)) { | 165 | if (IS_NANDDUMP && !(opts & OPT_b)) { |
166 | int bad_len = MIN(tmp, end_addr) - mtdoffset; | 166 | int bad_len = MIN(tmp, end_addr) - mtdoffset; |
167 | dump_bad(&meminfo, bad_len, !(opts & OPT_o)); | 167 | dump_bad(&meminfo, bad_len, opts & OPT_o); |
168 | } | 168 | } |
169 | mtdoffset = tmp; | 169 | mtdoffset = tmp; |
170 | } | 170 | } |
@@ -182,9 +182,9 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv) | |||
182 | mtdoffset = next_good_eraseblock(fd, &meminfo, blockstart); | 182 | mtdoffset = next_good_eraseblock(fd, &meminfo, blockstart); |
183 | if (IS_NANDWRITE) | 183 | if (IS_NANDWRITE) |
184 | printf("Writing at 0x%08x\n", mtdoffset); | 184 | printf("Writing at 0x%08x\n", mtdoffset); |
185 | else if (mtdoffset > blockstart) { | 185 | else if (mtdoffset > blockstart && !(opts & OPT_b)) { |
186 | int bad_len = MIN(mtdoffset, limit) - blockstart; | 186 | int bad_len = MIN(mtdoffset, limit) - blockstart; |
187 | dump_bad(&meminfo, bad_len, !(opts & OPT_o)); | 187 | dump_bad(&meminfo, bad_len, opts & OPT_o); |
188 | } | 188 | } |
189 | if (mtdoffset >= limit) | 189 | if (mtdoffset >= limit) |
190 | break; | 190 | break; |
@@ -210,7 +210,7 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv) | |||
210 | } | 210 | } |
211 | xwrite(output_fd, filebuf, meminfo_writesize); | 211 | xwrite(output_fd, filebuf, meminfo_writesize); |
212 | 212 | ||
213 | if (IS_NANDDUMP && !(opts & OPT_o)) { | 213 | if (IS_NANDDUMP && (opts & OPT_o)) { |
214 | /* Dump OOB data */ | 214 | /* Dump OOB data */ |
215 | oob.start = mtdoffset; | 215 | oob.start = mtdoffset; |
216 | xioctl(fd, MEMREADOOB, &oob); | 216 | xioctl(fd, MEMREADOOB, &oob); |