]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
hweight32()
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 27 Jun 2022 19:20:54 +0000 (15:20 -0400)
committerKent Overstreet <kent.overstreet@gmail.com>
Mon, 27 Jun 2022 19:58:39 +0000 (15:58 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
include/linux/bitops.h

index 2fe736e95b86cc333b50019e049c0490891ddfbb..62a3f4040a73a6ea812f7b72bd691a4f38143de4 100644 (file)
@@ -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);