mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
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. 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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user