Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283082
b: refs/heads/master
c: 5742332
h: refs/heads/master
v: v3
  • Loading branch information
Joakim Tjernlund authored and Linus Torvalds committed Jan 11, 2012
1 parent 65dfc65 commit 6113ebd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfcb2cc798a14230d22b6dd999e2e680623de622
refs/heads/master: 5742332dea5560d6c449b007d9539dbdc8ee531b
21 changes: 11 additions & 10 deletions trunk/lib/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,21 @@ static inline u32
crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256])
{
# ifdef __LITTLE_ENDIAN
# define DO_CRC(x) crc = tab[0][(crc ^ (x)) & 255] ^ (crc >> 8)
# define DO_CRC4 crc = tab[3][(crc) & 255] ^ \
tab[2][(crc >> 8) & 255] ^ \
tab[1][(crc >> 16) & 255] ^ \
tab[0][(crc >> 24) & 255]
# define DO_CRC(x) crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8)
# define DO_CRC4 crc = t3[(crc) & 255] ^ \
t2[(crc >> 8) & 255] ^ \
t1[(crc >> 16) & 255] ^ \
t0[(crc >> 24) & 255]
# else
# define DO_CRC(x) crc = tab[0][((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
# define DO_CRC4 crc = tab[0][(crc) & 255] ^ \
tab[1][(crc >> 8) & 255] ^ \
tab[2][(crc >> 16) & 255] ^ \
tab[3][(crc >> 24) & 255]
# define DO_CRC(x) crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
# define DO_CRC4 crc = t0[(crc) & 255] ^ \
t1[(crc >> 8) & 255] ^ \
t2[(crc >> 16) & 255] ^ \
t3[(crc >> 24) & 255]
# endif
const u32 *b;
size_t rem_len;
const u32 *t0=tab[0], *t1=tab[1], *t2=tab[2], *t3=tab[3];

/* Align it */
if (unlikely((long)buf & 3 && len)) {
Expand Down

0 comments on commit 6113ebd

Please sign in to comment.