Fix build on 32 bit

size_t is apparently not an unsigned long on 32 bit, which is what
rounddown_pow_of_two() returns.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-11-07 21:17:06 -05:00
parent d6d1d8e519
commit 29e27cc492

View File

@ -27,7 +27,8 @@ static inline void *kmalloc_noprof(size_t size, gfp_t flags)
for (i = 0; i < 10; i++) {
if (size) {
size_t alignment = min(rounddown_pow_of_two(size), (size_t)PAGE_SIZE);
size_t alignment = min_t(size_t, PAGE_SIZE,
rounddown_pow_of_two(size));
alignment = max(sizeof(void *), alignment);
if (posix_memalign(&p, alignment, size))
p = NULL;