From b45fb614a4cce8e7f014df9057e1165e4867907b Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 20 Jun 2023 09:49:10 +0800 Subject: [PATCH] util: use uint32_t instead of unsigned in bitscan.h uint32_t is more exact than unsigned for these functions Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Part-of: --- src/util/bitscan.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/bitscan.h b/src/util/bitscan.h index acdde6e7063..3da2e9639e4 100644 --- a/src/util/bitscan.h +++ b/src/util/bitscan.h @@ -122,13 +122,13 @@ u_bit_scan64(uint64_t *mask) ((b) = ffsll(__dword) - 1, __dword); \ __dword &= ~(1ull << (b))) -/* Determine if an unsigned value is a power of two. +/* Determine if an uint32_t value is a power of two. * * \note * Zero is treated as a power of two. */ static inline bool -util_is_power_of_two_or_zero(unsigned v) +util_is_power_of_two_or_zero(uint32_t v) { return IS_POT(v); } @@ -144,13 +144,13 @@ util_is_power_of_two_or_zero64(uint64_t v) return IS_POT(v); } -/* Determine if an unsigned value is a power of two. +/* Determine if an uint32_t value is a power of two. * * \note * Zero is \b not treated as a power of two. */ static inline bool -util_is_power_of_two_nonzero(unsigned v) +util_is_power_of_two_nonzero(uint32_t v) { /* __POPCNT__ is different from HAVE___BUILTIN_POPCOUNT. The latter * indicates the existence of the __builtin_popcount function. The former