From 29e27cc49234571477c9840a7112270069553abc Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 7 Nov 2023 21:17:06 -0500 Subject: [PATCH] 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 --- include/linux/slab.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 25ccf1a..ca0c793 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -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; -- 2.39.2