summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-15 05:08:45 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2008-01-10 22:16:14 +0100
commit468577abe37ff7b453a9ac613e0ea155349203ae (patch)
tree45151ac6f36be2327bec63cf44870acb1383afb4
parent[CRYPTO] hifn: Add missing includes (diff)
downloadlinux-468577abe37ff7b453a9ac613e0ea155349203ae.tar.xz
linux-468577abe37ff7b453a9ac613e0ea155349203ae.zip
[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>
-rw-r--r--crypto/digest.c3
-rw-r--r--crypto/hmac.c2
-rw-r--r--crypto/scatterwalk.c2
-rw-r--r--crypto/scatterwalk.h5
4 files changed, 3 insertions, 9 deletions
diff --git a/crypto/digest.c b/crypto/digest.c
index 8871dec8cae7..d3e827a141f1 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -21,7 +21,6 @@
#include <linux/scatterlist.h>
#include "internal.h"
-#include "scatterwalk.h"
static int init(struct hash_desc *desc)
{
@@ -77,7 +76,7 @@ static int update2(struct hash_desc *desc,
if (!nbytes)
break;
- sg = scatterwalk_sg_next(sg);
+ sg = sg_next(sg);
}
return 0;
diff --git a/crypto/hmac.c b/crypto/hmac.c
index 0f05be769c34..34c3706db85d 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -160,7 +160,7 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
sg_init_table(sg1, 2);
sg_set_buf(sg1, ipad, bs);
- sg_set_page(&sg1[1], (void *) sg, 0, 0);
+ sg_chain(sg1, 2, sg);
sg_init_table(sg2, 1);
sg_set_buf(sg2, opad, bs + ds);
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index b9bbda0bb9f9..206c39a97e57 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -62,7 +62,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
walk->offset += PAGE_SIZE - 1;
walk->offset &= PAGE_MASK;
if (walk->offset >= walk->sg->offset + walk->sg->length)
- scatterwalk_start(walk, scatterwalk_sg_next(walk->sg));
+ scatterwalk_start(walk, sg_next(walk->sg));
}
}
diff --git a/crypto/scatterwalk.h b/crypto/scatterwalk.h
index 87ed681cceba..fd5517d2a7a9 100644
--- a/crypto/scatterwalk.h
+++ b/crypto/scatterwalk.h
@@ -20,11 +20,6 @@
#include "internal.h"
-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)
{