diff mbox series

[kvm-unit-tests,1/2] compiler.h: Fix typos in mul and sub overflow checks

Message ID 20211013164259.88281-2-drjones@redhat.com (mailing list archive)
State New, archived
Headers show
Series Introduce strtoll/strtoull | expand

Commit Message

Andrew Jones Oct. 13, 2021, 4:42 p.m. UTC
Fixes: 4ceb02bf68f0 ("compiler: Add builtin overflow flag and predicate wrappers")
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 lib/linux/compiler.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ahmed, Daniele Oct. 14, 2021, 9:56 a.m. UTC | #1
Reviewed-by: Daniele Ahmed <ahmeddan@amazon.com>




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
diff mbox series

Patch

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; })