Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: talitos - stop using crypto_ahash::init

The function pointer crypto_ahash::init is an internal implementation
detail of the ahash API that exists to help it support both ahash and
shash algorithms. With an upcoming refactoring of how the ahash API
supports shash algorithms, this field will be removed.

Some drivers are invoking crypto_ahash::init to call into their own
code, which is unnecessary and inefficient. The talitos driver is one
of those drivers. Make it just call its own code directly.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
9826d1d6 9416210f

+9 -6
+9 -6
drivers/crypto/talitos.c
··· 2119 2119 2120 2120 static int ahash_digest(struct ahash_request *areq) 2121 2121 { 2122 - struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); 2123 - struct crypto_ahash *ahash = crypto_ahash_reqtfm(areq); 2122 + ahash_init(areq); 2123 + return ahash_finup(areq); 2124 + } 2124 2125 2125 - ahash->init(areq); 2126 - req_ctx->last = 1; 2127 - 2128 - return ahash_process_req(areq, areq->nbytes); 2126 + static int ahash_digest_sha224_swinit(struct ahash_request *areq) 2127 + { 2128 + ahash_init_sha224_swinit(areq); 2129 + return ahash_finup(areq); 2129 2130 } 2130 2131 2131 2132 static int ahash_export(struct ahash_request *areq, void *out) ··· 3241 3240 (!strcmp(alg->cra_name, "sha224") || 3242 3241 !strcmp(alg->cra_name, "hmac(sha224)"))) { 3243 3242 t_alg->algt.alg.hash.init = ahash_init_sha224_swinit; 3243 + t_alg->algt.alg.hash.digest = 3244 + ahash_digest_sha224_swinit; 3244 3245 t_alg->algt.desc_hdr_template = 3245 3246 DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU | 3246 3247 DESC_HDR_SEL0_MDEUA |