Commit 8ddef4d6 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a valgrind conditional jump

Valgrind was complaining about a jump depending on uninitialized memory
- we weren't, but this change makes the code less confusing for valgrind
to follow.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent c8476a4e
...@@ -97,7 +97,7 @@ int bch2_varint_encode_fast(u8 *out, u64 v) ...@@ -97,7 +97,7 @@ int bch2_varint_encode_fast(u8 *out, u64 v)
int bch2_varint_decode_fast(const u8 *in, const u8 *end, u64 *out) int bch2_varint_decode_fast(const u8 *in, const u8 *end, u64 *out)
{ {
u64 v = get_unaligned_le64(in); u64 v = get_unaligned_le64(in);
unsigned bytes = ffz(v & 255) + 1; unsigned bytes = ffz(*in) + 1;
if (unlikely(in + bytes > end)) if (unlikely(in + bytes > end))
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment