summaryrefslogtreecommitdiff
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorYuxuan Shui <yshuiv7@gmail.com>2020-05-03 19:21:17 +0100
committerYuxuan Shui <yshuiv7@gmail.com>2020-05-05 10:29:31 +0100
commit5bc48bd428303aabe19c196a47d1d89a605397be (patch)
tree10d75608bf415e37810e7846c80193218e35b4e5 /include/linux/slab.h
parent6e9f4602408e9bcdb33bce6ab3a2d8562613d6ce (diff)
Fix building on musl
* Add missing linux/stddef.h includes * Explicitly cast PAGE_SIZE to size_t. PAGE_SIZE is defined without UL suffix in musl * Musl doesn't define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, so initialize the mutexes with pthread_once.
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 5a9e7afd..d77b7683 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -22,7 +22,7 @@ static inline void *kmalloc(size_t size, gfp_t flags)
p = size
? aligned_alloc(min(rounddown_pow_of_two(size),
- PAGE_SIZE), size)
+ (size_t)PAGE_SIZE), size)
: malloc(0);
if (p && (flags & __GFP_ZERO))
memset(p, 0, size);