[PATCH 1/5] lib/find_bit: rename "le" to "need_swab" in __find_next_bit()
From: Yury Norov
Date: Thu Jul 28 2022 - 12:12:29 EST
The parameter is used to swap bytes on BE machines when searching for
bits in little-endian bitmaps. On LE machines this parameter is 0, which
misleads readers.
Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
---
lib/find_bit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/find_bit.c b/lib/find_bit.c
index 1b8e4b2a9cba..04c142acfc40 100644
--- a/lib/find_bit.c
+++ b/lib/find_bit.c
@@ -31,7 +31,7 @@
*/
unsigned long _find_next_bit(const unsigned long *addr1,
const unsigned long *addr2, unsigned long nbits,
- unsigned long start, unsigned long invert, unsigned long le)
+ unsigned long start, unsigned long invert, bool need_swab)
{
unsigned long tmp, mask;
@@ -45,7 +45,7 @@ unsigned long _find_next_bit(const unsigned long *addr1,
/* Handle 1st word. */
mask = BITMAP_FIRST_WORD_MASK(start);
- if (le)
+ if (need_swab)
mask = swab(mask);
tmp &= mask;
@@ -63,7 +63,7 @@ unsigned long _find_next_bit(const unsigned long *addr1,
tmp ^= invert;
}
- if (le)
+ if (need_swab)
tmp = swab(tmp);
return min(start + __ffs(tmp), nbits);
--
2.34.1