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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux