[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251018043106.375964-6-ebiggers@kernel.org>
Date: Fri, 17 Oct 2025 21:31:01 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: linux-crypto@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Ard Biesheuvel <ardb@...nel.org>,
"Jason A . Donenfeld" <Jason@...c4.com>,
Eric Biggers <ebiggers@...nel.org>
Subject: [PATCH 05/10] byteorder: Add le64_to_cpu_array() and cpu_to_le64_array()
Add le64_to_cpu_array() and cpu_to_le64_array(). These mirror the
corresponding 32-bit functions.
These will be used by the BLAKE2b code.
Signed-off-by: Eric Biggers <ebiggers@...nel.org>
---
include/linux/byteorder/generic.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h
index b3705e8bbe2b8..55a44199de872 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -171,10 +171,26 @@ static inline void cpu_to_le32_array(u32 *buf, unsigned int words)
__cpu_to_le32s(buf);
buf++;
}
}
+static inline void le64_to_cpu_array(u64 *buf, unsigned int words)
+{
+ while (words--) {
+ __le64_to_cpus(buf);
+ buf++;
+ }
+}
+
+static inline void cpu_to_le64_array(u64 *buf, unsigned int words)
+{
+ while (words--) {
+ __cpu_to_le64s(buf);
+ buf++;
+ }
+}
+
static inline void memcpy_from_le32(u32 *dst, const __le32 *src, size_t words)
{
size_t i;
for (i = 0; i < words; i++)
--
2.51.1.dirty
Powered by blists - more mailing lists