aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-01-04 19:55:06 +0700
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-01-04 19:55:06 +0700
commit3f357a9c754805c4c38793749927aeda82797735 (patch)
tree65bb50517515714b6baaa4d5d2debed1e716bc83 /miscutils
parent47a20f7daf954c90bbc77d2c108cb366171c650f (diff)
parent776509544123c68bbc128c0fdb2f699062d294cf (diff)
downloadbusybox-w32-3f357a9c754805c4c38793749927aeda82797735.tar.gz
busybox-w32-3f357a9c754805c4c38793749927aeda82797735.tar.bz2
busybox-w32-3f357a9c754805c4c38793749927aeda82797735.zip
Merge commit 'e4dcba1c103dc28e927e004791e331aaf604383d^'
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/flash_eraseall.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/miscutils/flash_eraseall.c b/miscutils/flash_eraseall.c
index 53aad3d52..b832cc1dd 100644
--- a/miscutils/flash_eraseall.c
+++ b/miscutils/flash_eraseall.c
@@ -42,15 +42,6 @@ but mtd/jffs2-user.h is gone now (at least 2.6.31.6 does not have it anymore)
42#define cpu_to_je16(v) ((jint16_t){(v)}) 42#define cpu_to_je16(v) ((jint16_t){(v)})
43#define cpu_to_je32(v) ((jint32_t){(v)}) 43#define cpu_to_je32(v) ((jint32_t){(v)})
44 44
45static uint32_t crc32(uint32_t val, const void *ss, int len,
46 uint32_t *crc32_table)
47{
48 const unsigned char *s = ss;
49 while (--len >= 0)
50 val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
51 return val;
52}
53
54static void show_progress(mtd_info_t *meminfo, erase_info_t *erase) 45static void show_progress(mtd_info_t *meminfo, erase_info_t *erase)
55{ 46{
56 printf("\rErasing %u Kibyte @ %x - %2u%% complete.", 47 printf("\rErasing %u Kibyte @ %x - %2u%% complete.",
@@ -131,8 +122,9 @@ int flash_eraseall_main(int argc UNUSED_PARAM, char **argv)
131 cleanmarker.totlen = cpu_to_je32(8); 122 cleanmarker.totlen = cpu_to_je32(8);
132 } 123 }
133 124
134 cleanmarker.hdr_crc = cpu_to_je32(crc32(0, &cleanmarker, sizeof(struct jffs2_unknown_node) - 4, 125 cleanmarker.hdr_crc = cpu_to_je32(
135 crc32_table)); 126 crc32_block_endian0(0, &cleanmarker, sizeof(struct jffs2_unknown_node) - 4, crc32_table)
127 );
136 } 128 }
137 129
138 /* Don't want to destroy progress indicator by bb_error_msg's */ 130 /* Don't want to destroy progress indicator by bb_error_msg's */