summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorYury Norov <ynorov@nvidia.com>2026-03-10 16:53:02 -0400
committerYury Norov <ynorov@nvidia.com>2026-03-23 13:33:51 -0400
commit18c48899653fa7a04120537c228031b5c7e4e9d6 (patch)
tree804360c62af6601c85ef471a08602101b4d3fbdb /include/linux
parentc6a98dff41bfb4ccc2c7f4ed596bcbf6994d5d1a (diff)
lib: crypto: fix comments for count_leading_zeros()
count_leading_zeros() is based on fls(), which is defined for x == 0, contrary to __ffs() family. The comment in crypto/mpi erroneously states that the function may return undef in such case. Fix the comment together with the outdated function signature, and now that COUNT_LEADING_ZEROS_0 is not referenced in the codebase, get rid of it too. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Yury Norov <ynorov@nvidia.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/count_zeros.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/count_zeros.h b/include/linux/count_zeros.h
index 5b8ff5ac660d..4e5680327ece 100644
--- a/include/linux/count_zeros.h
+++ b/include/linux/count_zeros.h
@@ -18,7 +18,7 @@
*
* If the MSB of @x is set, the result is 0.
* If only the LSB of @x is set, then the result is BITS_PER_LONG-1.
- * If @x is 0 then the result is COUNT_LEADING_ZEROS_0.
+ * If @x is 0 then the result is BITS_PER_LONG.
*/
static inline int count_leading_zeros(unsigned long x)
{
@@ -28,8 +28,6 @@ static inline int count_leading_zeros(unsigned long x)
return BITS_PER_LONG - fls64(x);
}
-#define COUNT_LEADING_ZEROS_0 BITS_PER_LONG
-
/**
* count_trailing_zeros - Count the number of zeros from the LSB forwards
* @x: The value