--- a/include/linux/bitops.h~bitops-avoid-clang-shift-count-overflow-warnings +++ a/include/linux/bitops.h @@ -72,7 +72,7 @@ static inline int get_bitmask_order(unsi static __always_inline unsigned long hweight_long(unsigned long w) { - return sizeof(w) == 4 ? hweight32(w) : hweight64(w); + return sizeof(w) == 4 ? hweight32(w) : hweight64((__u64)w); } /**