Skip to content

Commit 5e9578b

Browse files
gscuiherbertx
authored andcommitted
crypto: bcm - Simplify obtain the name for cipher
The crypto_ahash_alg_name(tfm) can obtain the name for cipher in include/crypto/hash.h, but now the function is not in use, so we use it to simplify the code, and optimize the code structure. Signed-off-by: Gaosheng Cui <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent edfc7e7 commit 5e9578b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/crypto/bcm/cipher.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@ static int ahash_enqueue(struct ahash_request *req)
19281928
/* SPU2 hardware does not compute hash of zero length data */
19291929
if ((rctx->is_final == 1) && (rctx->total_todo == 0) &&
19301930
(iproc_priv.spu.spu_type == SPU_TYPE_SPU2)) {
1931-
alg_name = crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
1931+
alg_name = crypto_ahash_alg_name(tfm);
19321932
flow_log("Doing %sfinal %s zero-len hash request in software\n",
19331933
rctx->is_final ? "" : "non-", alg_name);
19341934
err = do_shash((unsigned char *)alg_name, req->result,
@@ -2029,7 +2029,7 @@ static int ahash_init(struct ahash_request *req)
20292029
* supported by the hardware, we need to handle it in software
20302030
* by calling synchronous hash functions.
20312031
*/
2032-
alg_name = crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
2032+
alg_name = crypto_ahash_alg_name(tfm);
20332033
hash = crypto_alloc_shash(alg_name, 0, 0);
20342034
if (IS_ERR(hash)) {
20352035
ret = PTR_ERR(hash);

0 commit comments

Comments
 (0)