aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto/scatterwalk.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/crypto/scatterwalk.h')
-rw-r--r--include/crypto/scatterwalk.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
index 833d208c25d6..4fd95a323beb 100644
--- a/include/crypto/scatterwalk.h
+++ b/include/crypto/scatterwalk.h
@@ -68,6 +68,21 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
68 return (++sg)->length ? sg : (void *)sg_page(sg); 68 return (++sg)->length ? sg : (void *)sg_page(sg);
69} 69}
70 70
71static inline void scatterwalk_crypto_chain(struct scatterlist *head,
72 struct scatterlist *sg,
73 int chain, int num)
74{
75 if (chain) {
76 head->length += sg->length;
77 sg = scatterwalk_sg_next(sg);
78 }
79
80 if (sg)
81 scatterwalk_sg_chain(head, num, sg);
82 else
83 sg_mark_end(head);
84}
85
71static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, 86static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
72 struct scatter_walk *walk_out) 87 struct scatter_walk *walk_out)
73{ 88{