summaryrefslogtreecommitdiff
path: root/drivers/nfc/s3fwrn5
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-01 22:31:14 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 15:32:14 +1000
commit96a5aa721df8e740f8d33fe7eae18acc157a000d (patch)
tree874e2a5eb10c0c6f891b9bc6debe36be399f6481 /drivers/nfc/s3fwrn5
parentecca1ad60cdfc061c1242490637e9e806ff1d884 (diff)
downloadlinux-rpi-96a5aa721df8e740f8d33fe7eae18acc157a000d.tar.gz
linux-rpi-96a5aa721df8e740f8d33fe7eae18acc157a000d.tar.bz2
linux-rpi-96a5aa721df8e740f8d33fe7eae18acc157a000d.zip
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 <r.baldyga@samsung.com> Cc: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/nfc/s3fwrn5')
-rw-r--r--drivers/nfc/s3fwrn5/firmware.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c
index de613c623a2c..69857f080704 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) {