From: Kent Overstreet Date: Mon, 27 Jun 2022 19:20:54 +0000 (-0400) Subject: hweight32() X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=64ddfc9fc5628f27cdc1399a283452196a7e2dcc;p=bcachefs-tools-debian hweight32() Signed-off-by: Kent Overstreet --- diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 2fe736e..62a3f40 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);