From 5ebd20d839d0b32a1ec53ebcf68c0030f40bc8f9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 20 Mar 2020 17:23:00 +0000 Subject: [PATCH] scst/include/backport.h: Backport cpu_to_be32_array() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8838 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 566ad0112..53bcc4335 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -182,6 +182,21 @@ static inline void *bsg_job_sense(struct bsg_job *job) #endif #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) */ +/* */ +/* + * See also f2f2efb807d3 ("byteorder: Move {cpu_to_be32, be32_to_cpu}_array() + * from Thunderbolt to core") # v4.15. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) +static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len) +{ + int i; + + for (i = 0; i < len; i++) + dst[i] = cpu_to_be32(src[i]); +} +#endif + /* */ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)