summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-01 22:31:22 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 15:32:16 +1000
commit85fc78b80f15d723db3aa8f368b414ee70a1937c (patch)
treeebbde9e7b9f899a26ef71b32d43c32ca7f3ba009
parentbce395eea0f2da2b9ca2e78f101ade353686ee5c (diff)
ASoC: cros_ec_codec: use crypto_shash_tfm_digest()
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>
-rw-r--r--sound/soc/codecs/cros_ec_codec.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c
index d3dc42aa6825..bfdd852bdc0d 100644
--- a/sound/soc/codecs/cros_ec_codec.c
+++ b/sound/soc/codecs/cros_ec_codec.c
@@ -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);