summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2019-11-08 13:22:27 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2019-11-17 09:02:42 +0800
commit7c8703ecdd68c3c2e0a347c35e46150b6980c115 (patch)
treeb4d05eebd5b018431b12435cdf540ce0cbf4bc92
parentf9c88283df6979e2dccafc20ee0b4d7281819d3e (diff)
downloadlinux-crypto-7c8703ecdd68c3c2e0a347c35e46150b6980c115.tar.gz
linux-crypto-7c8703ecdd68c3c2e0a347c35e46150b6980c115.zip
int128: move __uint128_t compiler test to Kconfig
In order to use 128-bit integer arithmetic in C code, the architecture needs to have declared support for it by setting ARCH_SUPPORTS_INT128, and it requires a version of the toolchain that supports this at build time. This is why all existing tests for ARCH_SUPPORTS_INT128 also test whether __SIZEOF_INT128__ is defined, since this is only the case for compilers that can support 128-bit integers. Let's fold this additional test into the Kconfig declaration of ARCH_SUPPORTS_INT128 so that we can also use the symbol in Makefiles, e.g., to decide whether a certain object needs to be included in the first place. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/ecc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ecc.c b/crypto/ecc.c
index 8ee78772..02d35be7 100644
--- a/crypto/ecc.c
+++ b/crypto/ecc.c
@@ -336,7 +336,7 @@ static u64 vli_usub(u64 *result, const u64 *left, u64 right,
static uint128_t mul_64_64(u64 left, u64 right)
{
uint128_t result;
-#if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__)
+#if defined(CONFIG_ARCH_SUPPORTS_INT128)
unsigned __int128 m = (unsigned __int128)left * right;
result.m_low = m;