summaryrefslogtreecommitdiff
path: root/ubi-utils/src/libubigen.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-01 14:10:21 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-01 14:31:52 +0300
commit8ab9e98ce27487c40289664d6cb1a58f963679cb (patch)
tree030ab5ecebdd08767bc34e0fb08f14b2d361c34b /ubi-utils/src/libubigen.c
parentf49f5405d6baeaf074b1803a6abc116caf130b9d (diff)
rename crc32 to mtd_crc32
Because of namespace collisions mkfs.ubifs uses crc32() implementation from /lib/libz.so.1, which generates incompatible CRC and later on the kernel reports many CRC errors. Fix this by re-naming mtd-utils' crc32 function to mtd_crc32. Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src/libubigen.c')
-rw-r--r--ubi-utils/src/libubigen.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ubi-utils/src/libubigen.c b/ubi-utils/src/libubigen.c
index 62792d0..710aa97 100644
--- a/ubi-utils/src/libubigen.c
+++ b/ubi-utils/src/libubigen.c
@@ -75,7 +75,7 @@ struct ubi_vtbl_record *ubigen_create_empty_vtbl(const struct ubigen_info *ui)
}
for (i = 0; i < ui->max_volumes; i++) {
- uint32_t crc = crc32(UBI_CRC32_INIT, &vtbl[i],
+ uint32_t crc = mtd_crc32(UBI_CRC32_INIT, &vtbl[i],
UBI_VTBL_RECORD_SIZE_CRC);
vtbl[i].crc = cpu_to_be32(crc);
}
@@ -117,7 +117,7 @@ int ubigen_add_volume(const struct ubigen_info *ui,
vtbl_rec->name[vi->name_len] = '\0';
vtbl_rec->name_len = cpu_to_be16(vi->name_len);
- tmp = crc32(UBI_CRC32_INIT, vtbl_rec, UBI_VTBL_RECORD_SIZE_CRC);
+ tmp = mtd_crc32(UBI_CRC32_INIT, vtbl_rec, UBI_VTBL_RECORD_SIZE_CRC);
vtbl_rec->crc = cpu_to_be32(tmp);
return 0;
}
@@ -136,7 +136,7 @@ void ubigen_init_ec_hdr(const struct ubigen_info *ui,
hdr->data_offset = cpu_to_be32(ui->data_offs);
hdr->image_seq = cpu_to_be32(ui->image_seq);
- crc = crc32(UBI_CRC32_INIT, hdr, UBI_EC_HDR_SIZE_CRC);
+ crc = mtd_crc32(UBI_CRC32_INIT, hdr, UBI_EC_HDR_SIZE_CRC);
hdr->hdr_crc = cpu_to_be32(crc);
}
@@ -160,11 +160,11 @@ void ubigen_init_vid_hdr(const struct ubigen_info *ui,
if (vi->type == UBI_VID_STATIC) {
hdr->data_size = cpu_to_be32(data_size);
hdr->used_ebs = cpu_to_be32(vi->used_ebs);
- crc = crc32(UBI_CRC32_INIT, data, data_size);
+ crc = mtd_crc32(UBI_CRC32_INIT, data, data_size);
hdr->data_crc = cpu_to_be32(crc);
}
- crc = crc32(UBI_CRC32_INIT, hdr, UBI_VID_HDR_SIZE_CRC);
+ crc = mtd_crc32(UBI_CRC32_INIT, hdr, UBI_VID_HDR_SIZE_CRC);
hdr->hdr_crc = cpu_to_be32(crc);
}