* [PATCH] lib/crc: Use uint64_t for the new NEON crc64 fold constants
@ 2026-11-22 15:29 Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-11-22 15:29 UTC (permalink / raw)
To: Eric Biggers
Cc: Ard Biesheuvel, Shreesh Adiga, Nathan Chancellor, linux-crypto,
llvm, linux-kernel
Commit ff049836f05f ("lib/crc: Don't include <linux/types.h> in NEON intrinsics
code") in mainline switched the arrays passed to vld1q_u64() to uint64_t, since
u64 and the uint64_t that vld1q_u64() takes are different types on arm64 once
<linux/types.h> is gone. The two arrays added by commit ef4102757fdd ("lib/crc:
Add 4-way folding in NEON crc64_nvme implementation") still use u64, so the
combination fails to build with clang:
lib/crc/crc64-neon.c:66:40: error: incompatible pointer types assigning
to 'const unsigned long *' from 'const u64 *' (aka 'const unsigned long
long *') [-Werror,-Wincompatible-pointer-types]
Use uint64_t for them too. This builds with and without ff049836f05f.
Fixes: ef4102757fdd ("lib/crc: Add 4-way folding in NEON crc64_nvme implementation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
crc-next is based on v7.4-rc2 and ff049836f05f went into mainline after
rc3, so linux-next will hit this once it merges the two. all-next hit
it already.
Tested on arm64: lib/crc/crc64-neon.o builds with clang and gcc on
crc-next, and with clang on crc-next merged with mainline 4843f6873f7c.
Without this patch the merged tree fails as above.
lib/crc/crc64-neon.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/crc/crc64-neon.c b/lib/crc/crc64-neon.c
index 03b46d0abcc41..f36389789fe65 100644
--- a/lib/crc/crc64-neon.c
+++ b/lib/crc/crc64-neon.c
@@ -11,11 +11,11 @@
u64 crc64_nvme_neon(u64 crc, const u8 *p, size_t len);
/* x^575 mod G, x^511 mod G */
-static const u64 fold_consts_4x_val[2] = { 0x0c32cdb31e18a84aULL,
- 0x62242240ace5045aULL };
+static const uint64_t fold_consts_4x_val[2] = { 0x0c32cdb31e18a84aULL,
+ 0x62242240ace5045aULL };
/* x^319 mod G, x^255 mod G */
-static const u64 fold_consts_2x_val[2] = { 0xb0bc2e589204f500ULL,
- 0xe1e0bb9d45d7a44cULL };
+static const uint64_t fold_consts_2x_val[2] = { 0xb0bc2e589204f500ULL,
+ 0xe1e0bb9d45d7a44cULL };
/* x^191 mod G, x^127 mod G */
static const u64 fold_consts_val[2] = { 0xeadc41fd2ba3d420ULL,
0x21e9761e252621acULL };
base-commit: ef4102757fdd84b0b6189260780ac5faf132edc7
--
2.53.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-22 15:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-22 15:29 [PATCH] lib/crc: Use uint64_t for the new NEON crc64 fold constants Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®