return;
}
- crc = crc32(0L, Z_NULL, 0);
+ crc = ul_crc32(0L, Z_NULL, 0);
buf =
mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
}
if (buf != MAP_FAILED) {
((struct cramfs_super *)((unsigned char *) buf + start))->fsid.crc =
- crc32(0L, Z_NULL, 0);
- crc = crc32(crc, (unsigned char *) buf + start, super.size - start);
+ ul_crc32(0L, Z_NULL, 0);
+ crc = ul_crc32(crc, (unsigned char *) buf + start, super.size - start);
munmap(buf, super.size);
} else {
int retval;
break;
if (length == 0)
((struct cramfs_super *)buf)->fsid.crc =
- crc32(0L, Z_NULL, 0);
+ ul_crc32(0L, Z_NULL, 0);
length += retval;
if (length > (super.size - start)) {
- crc = crc32(crc, buf,
+ crc = ul_crc32(crc, buf,
retval - (length -
(super.size - start)));
break;
}
- crc = crc32(crc, buf, retval);
+ crc = ul_crc32(crc, buf, retval);
}
free(buf);
}
super->size = size;
memcpy(super->signature, CRAMFS_SIGNATURE, sizeof(super->signature));
- super->fsid.crc = crc32(0L, Z_NULL, 0);
+ super->fsid.crc = ul_crc32(0L, Z_NULL, 0);
super->fsid.edition = opt_edition;
super->fsid.blocks = total_blocks;
super->fsid.files = total_nodes;
loff_t fslen_ub = sizeof(struct cramfs_super);
unsigned int fslen_max;
char const *dirname, *outfile;
- uint32_t crc = crc32(0L, Z_NULL, 0);
+ uint32_t crc = ul_crc32(0L, Z_NULL, 0);
int c;
cramfs_is_big_endian = HOST_IS_BIG_ENDIAN; /* default is to use host order */
sizeof(struct cramfs_super));
/* Put the checksum in. */
- crc = crc32(crc, (unsigned char *) (rom_image+opt_pad), (offset-opt_pad));
+ crc = ul_crc32(crc, (unsigned char *) (rom_image+opt_pad), (offset-opt_pad));
((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = u32_toggle_endianness(cramfs_is_big_endian, crc);
if (verbose)
printf(_("CRC: %x\n"), crc);
#include <sys/types.h>
#include <stdint.h>
-extern uint32_t crc32(uint32_t seed, const unsigned char *buf, size_t len);
-extern uint32_t crc32_exclude_offset(uint32_t seed, const unsigned char *buf, size_t len,
+extern uint32_t ul_crc32(uint32_t seed, const unsigned char *buf, size_t len);
+extern uint32_t ul_crc32_exclude_offset(uint32_t seed, const unsigned char *buf, size_t len,
size_t exclude_off, size_t exclude_len);
#endif
* and does __not__ xor at the end. Then individual users can do
* whatever they need.
*/
-uint32_t crc32(uint32_t seed, const unsigned char *buf, size_t len)
+uint32_t ul_crc32(uint32_t seed, const unsigned char *buf, size_t len)
{
uint32_t crc = seed;
const unsigned char *p = buf;
return crc;
}
-uint32_t crc32_exclude_offset(uint32_t seed, const unsigned char *buf, size_t len,
+uint32_t ul_crc32_exclude_offset(uint32_t seed, const unsigned char *buf, size_t len,
size_t exclude_off, size_t exclude_len)
{
uint32_t crc = seed;
static inline uint32_t count_crc32(const unsigned char *buf, size_t len,
size_t exclude_off, size_t exclude_len)
{
- return (crc32_exclude_offset(~0L, buf, len, exclude_off, exclude_len) ^ ~0L);
+ return (ul_crc32_exclude_offset(~0L, buf, len, exclude_off, exclude_len) ^ ~0L);
}
static inline unsigned char *get_lba_buffer(blkid_probe pr,
if (bytes < crc_start || bytes > sizeof(struct nilfs_super_block))
return 0;
- crc = crc32(le32_to_cpu(sb->s_crc_seed), (unsigned char *)sb, sumoff);
- crc = crc32(crc, sum, 4);
- crc = crc32(crc, (unsigned char *)sb + crc_start, bytes - crc_start);
+ crc = ul_crc32(le32_to_cpu(sb->s_crc_seed), (unsigned char *)sb, sumoff);
+ crc = ul_crc32(crc, sum, 4);
+ crc = ul_crc32(crc, (unsigned char *)sb + crc_start, bytes - crc_start);
return blkid_probe_verify_csum(pr, crc, le32_to_cpu(sb->s_sum));
}
static inline uint32_t count_crc32(const unsigned char *buf, size_t len,
size_t ex_off, size_t ex_len)
{
- return (crc32_exclude_offset(~0L, buf, len, ex_off, ex_len) ^ ~0L);
+ return (ul_crc32_exclude_offset(~0L, buf, len, ex_off, ex_len) ^ ~0L);
}
static inline uint32_t gpt_header_count_crc32(struct gpt_header *header)