From 8ddef4d6ccedcd571c9b81f6cd8dff8ddcdb918a Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 17 Aug 2021 15:03:53 -0400 Subject: [PATCH] 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 --- fs/bcachefs/varint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;