summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-08-17 15:03:53 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-01-05 20:17:09 -0500
commit971ffa5a7b3453d12a25f0bafa33ee6175efcec7 (patch)
tree547d3df946fac08e871abfd8f686ad90a6ecb2cd
parent9e5f6a0248d07ff073b450a96015338b152fcc31 (diff)
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: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/varint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/varint.c b/fs/bcachefs/varint.c
index 6955ff5dc19c..e87da470c581 100644
--- a/fs/bcachefs/varint.c
+++ b/fs/bcachefs/varint.c
@@ -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)
{
u64 v = get_unaligned_le64(in);
- unsigned bytes = ffz(v & 255) + 1;
+ unsigned bytes = ffz(*in) + 1;
if (unlikely(in + bytes > end))
return -1;