diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-27 10:10:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-27 10:10:40 -0700 |
commit | 0f5a2c553d1484141ebb369ecab61894e9cb074f (patch) | |
tree | ba7667fb37832e1714dc2a8b3b3e45dade4af5cb /crypto/tcrypt.c | |
parent | 26adc0d5859788b74f86677538236f807e6d9021 (diff) | |
parent | 68e3f5dd4db62619fdbe520d36c9ebf62e672256 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[CRYPTO] users: Fix up scatterlist conversion errors
[CRYPTO] tcrypt: Move sg_init_table out of timing loops
[NETNS]: Fix get_net_ns_by_pid
[NET]: Marking struct pernet_operations __net_initdata was inappropriate
[INET] ESP: Must #include <linux/scatterlist.h>
[TCP] IPV6: fix softnet build breakage
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r-- | crypto/tcrypt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index c457bdb2a42..24141fb6f5c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -572,9 +572,11 @@ static int test_hash_jiffies_digest(struct hash_desc *desc, char *p, int blen, int bcount; int ret; + sg_init_table(sg, 1); + for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { - sg_init_one(sg, p, blen); + sg_set_buf(sg, p, blen); ret = crypto_hash_digest(desc, sg, blen, out); if (ret) return ret; @@ -597,13 +599,15 @@ static int test_hash_jiffies(struct hash_desc *desc, char *p, int blen, if (plen == blen) return test_hash_jiffies_digest(desc, p, blen, out, sec); + sg_init_table(sg, 1); + for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { ret = crypto_hash_init(desc); if (ret) return ret; for (pcount = 0; pcount < blen; pcount += plen) { - sg_init_one(sg, p + pcount, plen); + sg_set_buf(sg, p + pcount, plen); ret = crypto_hash_update(desc, sg, plen); if (ret) return ret; @@ -628,12 +632,14 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen, int i; int ret; + sg_init_table(sg, 1); + local_bh_disable(); local_irq_disable(); /* Warm-up run. */ for (i = 0; i < 4; i++) { - sg_init_one(sg, p, blen); + sg_set_buf(sg, p, blen); ret = crypto_hash_digest(desc, sg, blen, out); if (ret) goto out; @@ -645,7 +651,7 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen, start = get_cycles(); - sg_init_one(sg, p, blen); + sg_set_buf(sg, p, blen); ret = crypto_hash_digest(desc, sg, blen, out); if (ret) goto out; @@ -679,6 +685,8 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (plen == blen) return test_hash_cycles_digest(desc, p, blen, out); + sg_init_table(sg, 1); + local_bh_disable(); local_irq_disable(); @@ -688,7 +696,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (ret) goto out; for (pcount = 0; pcount < blen; pcount += plen) { - sg_init_one(sg, p + pcount, plen); + sg_set_buf(sg, p + pcount, plen); ret = crypto_hash_update(desc, sg, plen); if (ret) goto out; @@ -708,7 +716,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (ret) goto out; for (pcount = 0; pcount < blen; pcount += plen) { - sg_init_one(sg, p + pcount, plen); + sg_set_buf(sg, p + pcount, plen); ret = crypto_hash_update(desc, sg, plen); if (ret) goto out; |