crypto: Deduplicate le32_to_cpu_array() and cpu_to_le32_array()
[linux-2.6-microblaze.git] / include / linux / byteorder / generic.h
index 451aaa0..4b13e0a 100644 (file)
@@ -156,6 +156,23 @@ static inline void le64_add_cpu(__le64 *var, u64 val)
        *var = cpu_to_le64(le64_to_cpu(*var) + val);
 }
 
+/* XXX: this stuff can be optimized */
+static inline void le32_to_cpu_array(u32 *buf, unsigned int words)
+{
+       while (words--) {
+               __le32_to_cpus(buf);
+               buf++;
+       }
+}
+
+static inline void cpu_to_le32_array(u32 *buf, unsigned int words)
+{
+       while (words--) {
+               __cpu_to_le32s(buf);
+               buf++;
+       }
+}
+
 static inline void be16_add_cpu(__be16 *var, u16 val)
 {
        *var = cpu_to_be16(be16_to_cpu(*var) + val);