summaryrefslogtreecommitdiffstats
path: root/include/linux/byteorder/generic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/byteorder/generic.h')
-rw-r--r--include/linux/byteorder/generic.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h
index 133b76d0d2c0..451aaa0786ae 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -171,4 +171,20 @@ static inline void be64_add_cpu(__be64 *var, u64 val)
*var = cpu_to_be64(be64_to_cpu(*var) + val);
}
+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]);
+}
+
+static inline void be32_to_cpu_array(u32 *dst, const __be32 *src, size_t len)
+{
+ int i;
+
+ for (i = 0; i < len; i++)
+ dst[i] = be32_to_cpu(src[i]);
+}
+
#endif /* _LINUX_BYTEORDER_GENERIC_H */
OpenPOWER on IntegriCloud