Skip to contentSkip to conversation

Remove two unused parameters

PATCH New Alan Huang 1 participant 3 messages Aug 10, 2024

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

cover Remove two unused parameters

This series simply removes two unused parameters.

Alan Huang (2):
bcachefs: Remove unused parameter of bkey_mantissa
bcachefs: Remove unused parameter of bkey_mantissa_bits_dropped

 fs/bcachefs/bset.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.45.2
author
#1 lore raw

PATCH 1/2 bcachefs: Remove unused parameter of bkey_mantissa

The idx parameter of bkey_mantissa became unused since commit b904a7991802 ("bcachefs: Go back to 16 bit mantissa bkey floats"), so remove it.

---
 fs/bcachefs/bset.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
fs/bcachefs/bset.c +3 -4
index e7c44f35f0c5..a2a87ed09f37 100644
@@ -585,8 +585,7 @@ static unsigned rw_aux_tree_bsearch(struct btree *b,
 }
 
 static inline unsigned bkey_mantissa(const struct bkey_packed *k,
-				     const struct bkey_float *f,
-				     unsigned idx)
+				     const struct bkey_float *f)
 {
 	u64 v;
 
@@ -668,7 +667,7 @@ static __always_inline void make_bfloat(struct btree *b, struct bset_tree *t,
 	EBUG_ON(shift < 0 || shift >= BFLOAT_FAILED);
 
 	f->exponent = shift;
-	mantissa = bkey_mantissa(m, f, j);
+	mantissa = bkey_mantissa(m, f);
 
 	/*
 	 * If we've got garbage bits, set them to all 1s - it's legal for the
@@ -1130,7 +1129,7 @@ static struct bkey_packed *bset_search_tree(const struct btree *b,
 			goto slowpath;
 
 		l = f->mantissa;
-		r = bkey_mantissa(packed_search, f, n);
+		r = bkey_mantissa(packed_search, f);
 
 		if (unlikely(l == r) && bkey_mantissa_bits_dropped(b, f, n))
 			goto slowpath;
Signature · 1 line
2.45.2
author
#2 lore raw

PATCH 2/2 bcachefs: Remove unused parameter of bkey_mantissa_bits_dropped

In reply to Alan Huang

The idx parameter of bkey_mantissa_bits_dropped is unused, remove it.

---
 fs/bcachefs/bset.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/bcachefs/bset.c +2 -3
index a2a87ed09f37..00a821f617a5 100644
@@ -1094,8 +1094,7 @@ static inline void prefetch_four_cachelines(void *p)
 }
 
 static inline bool bkey_mantissa_bits_dropped(const struct btree *b,
-					      const struct bkey_float *f,
-					      unsigned idx)
+					      const struct bkey_float *f)
 {
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 	unsigned key_bits_start = b->format.key_u64s * 64 - b->nr_key_bits;
@@ -1131,7 +1130,7 @@ static struct bkey_packed *bset_search_tree(const struct btree *b,
 		l = f->mantissa;
 		r = bkey_mantissa(packed_search, f);
 
-		if (unlikely(l == r) && bkey_mantissa_bits_dropped(b, f, n))
+		if (unlikely(l == r) && bkey_mantissa_bits_dropped(b, f))
 			goto slowpath;
 
 		n = n * 2 + (l < r);
Signature · 1 line
2.45.2