All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, thuth@redhat.com, ahmeddan@amazon.com
Subject: [PATCH kvm-unit-tests 1/2] compiler.h: Fix typos in mul and sub overflow checks
Date: Wed, 13 Oct 2021 18:42:58 +0200	[thread overview]
Message-ID: <20211013164259.88281-2-drjones@redhat.com> (raw)
In-Reply-To: <20211013164259.88281-1-drjones@redhat.com>

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(-)

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


  reply	other threads:[~2021-10-13 16:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 16:42 [PATCH kvm-unit-tests 0/2] Introduce strtoll/strtoull Andrew Jones
2021-10-13 16:42 ` Andrew Jones [this message]
2021-10-14  9:56   ` [PATCH kvm-unit-tests 1/2] compiler.h: Fix typos in mul and sub overflow checks Ahmed, Daniele
2021-10-13 16:42 ` [PATCH kvm-unit-tests 2/2] lib: Introduce strtoll/strtoull Andrew Jones
2021-10-14  9:45   ` Ahmed, Daniele
2021-10-15  9:15 ` [PATCH kvm-unit-tests 0/2] " Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211013164259.88281-2-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=ahmeddan@amazon.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.