lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 6 Dec 2020 15:47:49 +0900
From:   Levi Yun <ppbuk5246@...il.com>
To:     akpm@...ux-foundation.org, yury.norov@...il.com,
        andriy.shevchenko@...ux.intel.com,
        richard.weiyang@...ux.alibaba.com, christian.brauner@...ntu.com,
        arnd@...db.de, jpoimboe@...hat.com, changbin.du@...el.com,
        rdunlap@...radead.org, masahiroy@...nel.org,
        gregkh@...uxfoundation.org, peterz@...radead.org,
        peter.enderborg@...y.com, krzk@...nel.org,
        brendanhiggins@...gle.com, keescook@...omium.org,
        broonie@...nel.org, matti.vaittinen@...rohmeurope.com,
        mhiramat@...nel.org, jpa@....mail.kapsi.fi, nivedita@...m.mit.edu,
        glider@...gle.com, orson.zhai@...soc.com,
        takahiro.akashi@...aro.org, clm@...com, josef@...icpanda.com,
        dsterba@...e.com, dushistov@...l.ru
Cc:     linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
        linux-btrfs@...r.kernel.org
Subject: [PATCH v2 3/8] bitops/find.h: Add declaration find_last_zero_bit

Inspired find_next_*_bit function series, add find_last_zero_bit.
These patch adds declarations for find_last_zero_bit.
Also, I move declaration of find_last_bit to asm-generic/bitops/find.h
Because:
I think its declaration need not to in __KERNEL__ macro compared to
find_next_*_bit and find_first_*_bit.

Signed-off-by: Levi Yun <ppbuk5246@...il.com>
---
 include/asm-generic/bitops/find.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
index 9fdf21302fdf..eeb2d6669f83 100644
--- a/include/asm-generic/bitops/find.h
+++ b/include/asm-generic/bitops/find.h
@@ -80,6 +80,31 @@ extern unsigned long find_first_zero_bit(const unsigned long *addr,
 
 #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
 
+#ifndef find_last_bit
+/**
+ * find_last_bit - find the last set bit in a memory region
+ * @addr: The address to start the search at
+ * @size: The number of bits to search
+ *
+ * Returns the bit number of the last set bit, or size.
+ */
+extern unsigned long find_last_bit(const unsigned long *addr,
+				   unsigned long size);
+#endif
+
+#ifndef find_last_zero_bit
+/**
+ * find_last_zero_bit - find the last cleared bit in a memory region
+ * @addr: The address to start the search at
+ * @size: The maximum number of bits to search
+ *
+ * Returns the bit number of the first cleared bit.
+ * If no bits are zero, returns @size.
+ */
+extern unsigned long find_last_zero_bit(const unsigned long *addr,
+					 unsigned long size);
+#endif
+
 /**
  * find_next_clump8 - find next 8-bit clump with set bits in a memory region
  * @clump: location to store copy of found clump
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ