ASoC: cros_ec_codec: use sha256() instead of open coding
authorEric Biggers <ebiggers@google.com>
Wed, 8 Jul 2020 16:39:43 +0000 (09:39 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 16 Jul 2020 11:49:05 +0000 (21:49 +1000)
commit9d4cafa5a04aeba68cc12de47ffcd975079e2f83
treebcd185a9b96094033b07264cdde730c2210d5e74
parent5a7a0d9400677a5e88fdb362c4d32171384068f2
ASoC: cros_ec_codec: use sha256() instead of open coding

Now that there's a function that calculates the SHA-256 digest of a
buffer in one step, use it instead of sha256_init() + sha256_update() +
sha256_final().

Also simplify the code by inlining calculate_sha256() into its caller
and switching a debug log statement to use %*phN instead of bin2hex().

Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Cc: alsa-devel@alsa-project.org
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@google.com>
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