summaryrefslogtreecommitdiff
path: root/fs/bcachefs/varint.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-08-17 22:03:53 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:10 +0300
commit8ddef4d6ccedcd571c9b81f6cd8dff8ddcdb918a (patch)
treea051a863be2a1eb82e32b9a372933db8012f0730 /fs/bcachefs/varint.c
parentc8476a4eb29972d756df33c3eb85c5792f798748 (diff)
downloadlinux-8ddef4d6ccedcd571c9b81f6cd8dff8ddcdb918a.tar.xz
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>
Diffstat (limited to 'fs/bcachefs/varint.c')
-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;