]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/crypto/scatterwalk.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[mv-sheeva.git] / include / crypto / scatterwalk.h
index 07b6f17122d2e968ddede9281f94fb65754e806c..224658b8d80689560e6ebf7c7bd94c41a2ea76bf 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/scatterlist.h>
+#include <linux/sched.h>
 
 static inline enum km_type crypto_kmap_type(int out)
 {
@@ -52,6 +53,17 @@ static inline void crypto_yield(u32 flags)
                cond_resched();
 }
 
+static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num,
+                                       struct scatterlist *sg2)
+{
+       sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0);
+}
+
+static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
+{
+       return (++sg)->length ? sg : (void *)sg_page(sg);
+}
+
 static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
                                                struct scatter_walk *walk_out)
 {