summaryrefslogtreecommitdiffstats
path: root/lib/find_bit.c
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2022-09-14 19:07:28 -0700
committerYury Norov <yury.norov@gmail.com>2022-09-21 12:17:18 -0700
commit14a99e130f2758bc826a7e7a8bdf6f7400b54f0f (patch)
tree3b067dad53502e8e00c0fce608fe3b2587f2be91 /lib/find_bit.c
parent58414bbb58a8b49af20e3accae56f6f8344b2424 (diff)
downloadlinux-14a99e130f2758bc826a7e7a8bdf6f7400b54f0f.tar.gz
linux-14a99e130f2758bc826a7e7a8bdf6f7400b54f0f.tar.bz2
linux-14a99e130f2758bc826a7e7a8bdf6f7400b54f0f.zip
lib/find_bit: create find_first_zero_bit_le()
find_first_zero_bit_le() is an alias to find_next_zero_bit_le(), despite that 'next' is known to be slower than 'first' version. Now that we have common FIND_FIRST_BIT() macro helper, it's trivial to implement find_first_zero_bit_le() as a real function. Reviewed-by: Valentin Schneider <vschneid@redhat.com> Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'lib/find_bit.c')
-rw-r--r--lib/find_bit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/find_bit.c b/lib/find_bit.c
index 894b656f6836..61ec2992938b 100644
--- a/lib/find_bit.c
+++ b/lib/find_bit.c
@@ -160,3 +160,19 @@ unsigned long find_next_clump8(unsigned long *clump, const unsigned long *addr,
return offset;
}
EXPORT_SYMBOL(find_next_clump8);
+
+#ifdef __BIG_ENDIAN
+
+#ifndef find_first_zero_bit_le
+/*
+ * Find the first cleared bit in an LE memory region.
+ */
+unsigned long _find_first_zero_bit_le(const unsigned long *addr, unsigned long size)
+{
+ return FIND_FIRST_BIT(~addr[idx], swab, size);
+}
+EXPORT_SYMBOL(_find_first_zero_bit_le);
+
+#endif
+
+#endif /* __BIG_ENDIAN */