[RFC PATCH 04/17] crypto: virtio - Remove unused used length
From: Xie Yongji
Date: Mon May 17 2021 - 05:09:50 EST
The used length is not used in some cases. Let's drop it
and pass NULL to virtqueue_get_buf() instead.
Signed-off-by: Xie Yongji <xieyongji@xxxxxxxxxxxxx>
---
drivers/crypto/virtio/virtio_crypto_algs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/virtio/virtio_crypto_algs.c b/drivers/crypto/virtio/virtio_crypto_algs.c
index 583c0b535d13..818fe31ace38 100644
--- a/drivers/crypto/virtio/virtio_crypto_algs.c
+++ b/drivers/crypto/virtio/virtio_crypto_algs.c
@@ -118,7 +118,6 @@ static int virtio_crypto_alg_skcipher_init_session(
int encrypt)
{
struct scatterlist outhdr, key_sg, inhdr, *sgs[3];
- unsigned int tmp;
struct virtio_crypto *vcrypto = ctx->vcrypto;
int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT;
int err;
@@ -176,7 +175,7 @@ static int virtio_crypto_alg_skcipher_init_session(
* Trapping into the hypervisor, so the request should be
* handled immediately.
*/
- while (!virtqueue_get_buf(vcrypto->ctrl_vq, &tmp) &&
+ while (!virtqueue_get_buf(vcrypto->ctrl_vq, NULL) &&
!virtqueue_is_broken(vcrypto->ctrl_vq))
cpu_relax();
@@ -206,7 +205,6 @@ static int virtio_crypto_alg_skcipher_close_session(
int encrypt)
{
struct scatterlist outhdr, status_sg, *sgs[2];
- unsigned int tmp;
struct virtio_crypto_destroy_session_req *destroy_session;
struct virtio_crypto *vcrypto = ctx->vcrypto;
int err;
@@ -245,7 +243,7 @@ static int virtio_crypto_alg_skcipher_close_session(
}
virtqueue_kick(vcrypto->ctrl_vq);
- while (!virtqueue_get_buf(vcrypto->ctrl_vq, &tmp) &&
+ while (!virtqueue_get_buf(vcrypto->ctrl_vq, NULL) &&
!virtqueue_is_broken(vcrypto->ctrl_vq))
cpu_relax();
--
2.11.0