Fixes: 4ceb02bf68f0 ("compiler: Add builtin overflow flag and predicate wrappers") Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx> --- lib/linux/compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linux/compiler.h b/lib/linux/compiler.h index c7fc0cf0852e..6f565e4a5107 100644 --- a/lib/linux/compiler.h +++ b/lib/linux/compiler.h @@ -33,8 +33,8 @@ #elif GCC_VERSION >= 70100 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 #define check_add_overflow(a, b) __builtin_add_overflow_p(a, b, (typeof((a) + (b)))0) -#define check_sub_overflow(a, b) __builtin_add_overflow_p(a, b, (typeof((a) - (b)))0) -#define check_mul_overflow(a, b) __builtin_add_overflow_p(a, b, (typeof((a) * (b)))0) +#define check_sub_overflow(a, b) __builtin_sub_overflow_p(a, b, (typeof((a) - (b)))0) +#define check_mul_overflow(a, b) __builtin_mul_overflow_p(a, b, (typeof((a) * (b)))0) #else #define check_add_overflow(a, b) ({ (void)((int)(a) == (int)(b)); 0; }) #define check_sub_overflow(a, b) ({ (void)((int)(a) == (int)(b)); 0; }) -- 2.31.1