diff options
author | Harald Welte <laforge@osmocom.org> | 2020-12-06 15:13:09 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-12-06 15:14:35 +0100 |
commit | c172d9fe8d2609c3e7dc3739a877403d232e73bd (patch) | |
tree | 54180f29044170834bcc8820834352a5e71eac34 /include/osmocom/core | |
parent | 622cda3802be7b54075bae25839d55936a1c370a (diff) |
log2.h: Use uintXX_t instead of kernel specific types
Change-Id: Ieb872551bdbe514f2c77f9aeb2b9ee42f6573909
Diffstat (limited to 'include/osmocom/core')
-rw-r--r-- | include/osmocom/core/log2.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/osmocom/core/log2.h b/include/osmocom/core/log2.h index dfe9d37a..035ce86e 100644 --- a/include/osmocom/core/log2.h +++ b/include/osmocom/core/log2.h @@ -6,6 +6,7 @@ */ #pragma once +#include <stdint.h> #define __always_inline inline __attribute__((always_inline)) /* from linux/asm-generic/bitops/{fls,fls64}.h - could later be enhanced @@ -58,9 +59,9 @@ static __always_inline int fls(unsigned int x) * set bit if value is nonzero. The last (most significant) bit is * at position 64. */ -static __always_inline int fls64(__u64 x) +static __always_inline int fls64(uint64_t x) { - __u32 h = x >> 32; + uint32_t h = x >> 32; if (h) return fls(h) + 32; return fls(x); |