Commit 468577abe37ff7b453a9ac613e0ea155349203ae

Authored by Herbert Xu
1 parent 102d49d3d0

[CRYPTO] scatterwalk: Use generic scatterlist chaining

This patch converts the crypto scatterwalk code to use the generic
scatterlist chaining rather the version specific to crypto.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Showing 4 changed files with 3 additions and 9 deletions Side-by-side Diff

... ... @@ -21,7 +21,6 @@
21 21 #include <linux/scatterlist.h>
22 22  
23 23 #include "internal.h"
24   -#include "scatterwalk.h"
25 24  
26 25 static int init(struct hash_desc *desc)
27 26 {
... ... @@ -77,7 +76,7 @@
77 76  
78 77 if (!nbytes)
79 78 break;
80   - sg = scatterwalk_sg_next(sg);
  79 + sg = sg_next(sg);
81 80 }
82 81  
83 82 return 0;
... ... @@ -160,7 +160,7 @@
160 160  
161 161 sg_init_table(sg1, 2);
162 162 sg_set_buf(sg1, ipad, bs);
163   - sg_set_page(&sg1[1], (void *) sg, 0, 0);
  163 + sg_chain(sg1, 2, sg);
164 164  
165 165 sg_init_table(sg2, 1);
166 166 sg_set_buf(sg2, opad, bs + ds);
crypto/scatterwalk.c
... ... @@ -62,7 +62,7 @@
62 62 walk->offset += PAGE_SIZE - 1;
63 63 walk->offset &= PAGE_MASK;
64 64 if (walk->offset >= walk->sg->offset + walk->sg->length)
65   - scatterwalk_start(walk, scatterwalk_sg_next(walk->sg));
  65 + scatterwalk_start(walk, sg_next(walk->sg));
66 66 }
67 67 }
68 68  
crypto/scatterwalk.h
... ... @@ -20,11 +20,6 @@
20 20  
21 21 #include "internal.h"
22 22  
23   -static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
24   -{
25   - return (++sg)->length ? sg : (void *) sg_page(sg);
26   -}
27   -
28 23 static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
29 24 struct scatter_walk *walk_out)
30 25 {