From: Eric Biggers Date: Sat, 2 May 2020 05:31:14 +0000 (-0700) Subject: nfc: s3fwrn5: use crypto_shash_tfm_digest() X-Git-Tag: v5.10.7~2354^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96a5aa721df8e740f8d33fe7eae18acc157a000d;p=platform%2Fkernel%2Flinux-rpi.git nfc: s3fwrn5: 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: Robert Baldyga Cc: Krzysztof Opasiak Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu --- diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c index de613c6..69857f0 100644 --- a/drivers/nfc/s3fwrn5/firmware.c +++ b/drivers/nfc/s3fwrn5/firmware.c @@ -434,15 +434,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) goto out; } - { - SHASH_DESC_ON_STACK(desc, tfm); - - desc->tfm = tfm; - - ret = crypto_shash_digest(desc, fw->image, image_size, - hash_data); - shash_desc_zero(desc); - } + ret = crypto_shash_tfm_digest(tfm, fw->image, image_size, hash_data); crypto_free_shash(tfm); if (ret) {