From 64ddfc9fc5628f27cdc1399a283452196a7e2dcc Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 27 Jun 2022 15:20:54 -0400 Subject: hweight32() Signed-off-by: Kent Overstreet --- include/linux/bitops.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 2fe736e9..62a3f404 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -137,6 +137,11 @@ static inline unsigned long hweight64(u64 w) __builtin_popcount(w >> 32); } +static inline unsigned long hweight32(u32 w) +{ + return __builtin_popcount(w); +} + static inline unsigned long hweight8(unsigned long w) { return __builtin_popcountl(w); -- cgit v1.2.3