projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b95d447
)
byteorder: Add le64_to_cpu_array() and cpu_to_le64_array()
author
Eric Biggers
<ebiggers@kernel.org>
Sat, 18 Oct 2025 04:31:01 +0000
(21:31 -0700)
committer
Eric Biggers
<ebiggers@kernel.org>
Thu, 30 Oct 2025 05:04:24 +0000
(22:04 -0700)
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.
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link:
https://lore.kernel.org/r/20251018043106.375964-6-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
include/linux/byteorder/generic.h
patch
|
blob
|
history
diff --git
a/include/linux/byteorder/generic.h
b/include/linux/byteorder/generic.h
index
b3705e8
..
55a4419
100644
(file)
--- a/
include/linux/byteorder/generic.h
+++ b/
include/linux/byteorder/generic.h
@@
-173,6
+173,22
@@
static inline void cpu_to_le32_array(u32 *buf, unsigned int words)
}
}
+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;