]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: cros_ec_codec: use crypto_shash_tfm_digest()
authorEric Biggers <ebiggers@google.com>
Sat, 2 May 2020 05:31:22 +0000 (22:31 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 May 2020 05:32:16 +0000 (15:32 +1000)
Instead of manually allocating a 'struct shash_desc' on the stack and
calling crypto_shash_digest(), switch to using the new helper function
crypto_shash_tfm_digest() which does this for us.

Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
sound/soc/codecs/cros_ec_codec.c

index d3dc42aa682565d34aaeb36798112688334f7107..bfdd852bdc0de49925e74e206a39401f4e1c3064 100644 (file)
@@ -115,14 +115,7 @@ static int calculate_sha256(struct cros_ec_codec_priv *priv,
                return PTR_ERR(tfm);
        }
 
-       {
-               SHASH_DESC_ON_STACK(desc, tfm);
-
-               desc->tfm = tfm;
-
-               crypto_shash_digest(desc, buf, size, digest);
-               shash_desc_zero(desc);
-       }
+       crypto_shash_tfm_digest(tfm, buf, size, digest);
 
        crypto_free_shash(tfm);