diff options
author | Horia Geanta <horia.geanta@freescale.com> | 2012-08-02 10:16:38 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-08-28 11:56:26 -0400 |
commit | 602499a34247a890fd018c364c9bb6f9b931c1db (patch) | |
tree | 053c47b4673854d97dc2b9e2e6fcf78a83d8359c /drivers/crypto | |
parent | 60542505b0bccbc5e2e518c9dd6bee9a30546061 (diff) |
crypto: talitos - prune unneeded descriptor allocation param
talitos_edesc_alloc does not need hash_result param.
Checking whether dst scatterlist is NULL or not is all that is required.
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/talitos.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 8653f601b95f..f0507d167c2f 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -1134,7 +1134,6 @@ static size_t sg_copy_end_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
1134 | static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | 1134 | static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, |
1135 | struct scatterlist *src, | 1135 | struct scatterlist *src, |
1136 | struct scatterlist *dst, | 1136 | struct scatterlist *dst, |
1137 | int hash_result, | ||
1138 | unsigned int cryptlen, | 1137 | unsigned int cryptlen, |
1139 | unsigned int authsize, | 1138 | unsigned int authsize, |
1140 | int icv_stashing, | 1139 | int icv_stashing, |
@@ -1154,7 +1153,7 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | |||
1154 | src_nents = sg_count(src, cryptlen + authsize, &src_chained); | 1153 | src_nents = sg_count(src, cryptlen + authsize, &src_chained); |
1155 | src_nents = (src_nents == 1) ? 0 : src_nents; | 1154 | src_nents = (src_nents == 1) ? 0 : src_nents; |
1156 | 1155 | ||
1157 | if (hash_result) { | 1156 | if (!dst) { |
1158 | dst_nents = 0; | 1157 | dst_nents = 0; |
1159 | } else { | 1158 | } else { |
1160 | if (dst == src) { | 1159 | if (dst == src) { |
@@ -1206,7 +1205,7 @@ static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, | |||
1206 | struct crypto_aead *authenc = crypto_aead_reqtfm(areq); | 1205 | struct crypto_aead *authenc = crypto_aead_reqtfm(areq); |
1207 | struct talitos_ctx *ctx = crypto_aead_ctx(authenc); | 1206 | struct talitos_ctx *ctx = crypto_aead_ctx(authenc); |
1208 | 1207 | ||
1209 | return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, 0, | 1208 | return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, |
1210 | areq->cryptlen, ctx->authsize, icv_stashing, | 1209 | areq->cryptlen, ctx->authsize, icv_stashing, |
1211 | areq->base.flags); | 1210 | areq->base.flags); |
1212 | } | 1211 | } |
@@ -1451,8 +1450,8 @@ static struct talitos_edesc *ablkcipher_edesc_alloc(struct ablkcipher_request * | |||
1451 | struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); | 1450 | struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); |
1452 | struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); | 1451 | struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); |
1453 | 1452 | ||
1454 | return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, 0, | 1453 | return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, areq->nbytes, |
1455 | areq->nbytes, 0, 0, areq->base.flags); | 1454 | 0, 0, areq->base.flags); |
1456 | } | 1455 | } |
1457 | 1456 | ||
1458 | static int ablkcipher_encrypt(struct ablkcipher_request *areq) | 1457 | static int ablkcipher_encrypt(struct ablkcipher_request *areq) |
@@ -1631,8 +1630,8 @@ static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq, | |||
1631 | struct talitos_ctx *ctx = crypto_ahash_ctx(tfm); | 1630 | struct talitos_ctx *ctx = crypto_ahash_ctx(tfm); |
1632 | struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); | 1631 | struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); |
1633 | 1632 | ||
1634 | return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, 1, | 1633 | return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, nbytes, 0, 0, |
1635 | nbytes, 0, 0, areq->base.flags); | 1634 | areq->base.flags); |
1636 | } | 1635 | } |
1637 | 1636 | ||
1638 | static int ahash_init(struct ahash_request *areq) | 1637 | static int ahash_init(struct ahash_request *areq) |