From: Kent Overstreet Date: Wed, 8 Nov 2023 02:17:06 +0000 (-0500) Subject: Fix build on 32 bit X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=29e27cc49234571477c9840a7112270069553abc;p=bcachefs-tools-debian 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 --- 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;