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>
This commit is contained in:
Родитель
60542505b0
Коммит
602499a342
|
@ -1134,7 +1134,6 @@ static size_t sg_copy_end_to_buffer(struct scatterlist *sgl, unsigned int nents,
|
||||||
static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
||||||
struct scatterlist *src,
|
struct scatterlist *src,
|
||||||
struct scatterlist *dst,
|
struct scatterlist *dst,
|
||||||
int hash_result,
|
|
||||||
unsigned int cryptlen,
|
unsigned int cryptlen,
|
||||||
unsigned int authsize,
|
unsigned int authsize,
|
||||||
int icv_stashing,
|
int icv_stashing,
|
||||||
|
@ -1154,7 +1153,7 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
||||||
src_nents = sg_count(src, cryptlen + authsize, &src_chained);
|
src_nents = sg_count(src, cryptlen + authsize, &src_chained);
|
||||||
src_nents = (src_nents == 1) ? 0 : src_nents;
|
src_nents = (src_nents == 1) ? 0 : src_nents;
|
||||||
|
|
||||||
if (hash_result) {
|
if (!dst) {
|
||||||
dst_nents = 0;
|
dst_nents = 0;
|
||||||
} else {
|
} else {
|
||||||
if (dst == src) {
|
if (dst == src) {
|
||||||
|
@ -1206,7 +1205,7 @@ static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq,
|
||||||
struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
|
struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
|
||||||
struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
|
struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
|
||||||
|
|
||||||
return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, 0,
|
return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst,
|
||||||
areq->cryptlen, ctx->authsize, icv_stashing,
|
areq->cryptlen, ctx->authsize, icv_stashing,
|
||||||
areq->base.flags);
|
areq->base.flags);
|
||||||
}
|
}
|
||||||
|
@ -1451,8 +1450,8 @@ static struct talitos_edesc *ablkcipher_edesc_alloc(struct ablkcipher_request *
|
||||||
struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq);
|
struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq);
|
||||||
struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
||||||
|
|
||||||
return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, 0,
|
return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, areq->nbytes,
|
||||||
areq->nbytes, 0, 0, areq->base.flags);
|
0, 0, areq->base.flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ablkcipher_encrypt(struct ablkcipher_request *areq)
|
static int ablkcipher_encrypt(struct ablkcipher_request *areq)
|
||||||
|
@ -1631,8 +1630,8 @@ static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq,
|
||||||
struct talitos_ctx *ctx = crypto_ahash_ctx(tfm);
|
struct talitos_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||||
struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);
|
struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);
|
||||||
|
|
||||||
return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, 1,
|
return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, nbytes, 0, 0,
|
||||||
nbytes, 0, 0, areq->base.flags);
|
areq->base.flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ahash_init(struct ahash_request *areq)
|
static int ahash_init(struct ahash_request *areq)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче