... and drop generic_hweight32().
As noted previously, the only two users of hweight32() are in __init paths.
The int-optimised form of generic_hweight() is only two instructions shorter
than the long-optimised form, and even then only on architectures which lack
fast multiplication, so there's no point providing an int-optimised form.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
* The Hamming Weight of a number is the total number of bits set in it.
*/
#define hweight64(x) generic_hweight64(x)
-#define hweight32(x) generic_hweight32(x)
#endif /* _ARM_BITOPS_H */
/*
* The Hamming Weight of a number is the total number of bits set in it.
*/
#define hweight64(x) __builtin_popcountll(x)
-#define hweight32(x) __builtin_popcount(x)
#endif /* _ASM_PPC_BITOPS_H */
* The Hamming Weight of a number is the total number of bits set in it.
*/
#define hweight64(x) generic_hweight64(x)
-#define hweight32(x) generic_hweight32(x)
#endif /* _X86_BITOPS_H */
#endif
}
+static always_inline attr_const unsigned int hweight32(uint32_t x)
+{
+ return hweightl(x);
+}
+
/* --------------------- Please tidy below here --------------------- */
#ifndef find_next_bit