Skip to content

Commit

Permalink
Merge pull request #71 from lorelei-sakai/fix/murmurhash_unaligned
Browse files Browse the repository at this point in the history
Remove u64 alignment requirement in murmurhash3 computations
  • Loading branch information
lorelei-sakai authored Oct 31, 2024
2 parents 5aba5bd + d0e4db8 commit 6e3446b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/md/dm-vdo/murmurhash3.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@ void murmurhash3_128(const void *key, const int len, const u32 seed, void *out)
u64 *hash_out = out;

/* body */

const u64 *blocks = (const u64 *)(data);

int i;

for (i = 0; i < nblocks; i++) {
u64 k1 = get_unaligned_le64(&blocks[i * 2]);
u64 k2 = get_unaligned_le64(&blocks[i * 2 + 1]);
u64 k1 = get_unaligned_le64(&data[i * 16]);
u64 k2 = get_unaligned_le64(&data[i * 16 + 8]);

k1 *= c1;
k1 = ROTL64(k1, 31);
Expand Down

0 comments on commit 6e3446b

Please sign in to comment.