public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] virtio-crypto: Remove unused virtcrypto functions
@ 2025-06-14  0:05 linux
  2025-06-16  2:51 ` Zenghui Yu
  2025-06-23  9:20 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: linux @ 2025-06-14  0:05 UTC (permalink / raw)
  To: arei.gonglei, mst, jasowang, xuanzhuo, eperezma
  Cc: herbert, davem, virtualization, linux-crypto, linux-kernel,
	Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

virtcrypto_devmgr_get_first() and virtcrypto_dev_in_use() were added in
2016 by
commit dbaf0624ffa5 ("crypto: add virtio-crypto driver")

but have remained unused.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/crypto/virtio/virtio_crypto_common.h |  2 --
 drivers/crypto/virtio/virtio_crypto_mgr.c    | 36 --------------------
 2 files changed, 38 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_crypto_common.h b/drivers/crypto/virtio/virtio_crypto_common.h
index 7059bbe5a2eb..19c934af3df6 100644
--- a/drivers/crypto/virtio/virtio_crypto_common.h
+++ b/drivers/crypto/virtio/virtio_crypto_common.h
@@ -113,8 +113,6 @@ struct virtio_crypto_request {
 int virtcrypto_devmgr_add_dev(struct virtio_crypto *vcrypto_dev);
 struct list_head *virtcrypto_devmgr_get_head(void);
 void virtcrypto_devmgr_rm_dev(struct virtio_crypto *vcrypto_dev);
-struct virtio_crypto *virtcrypto_devmgr_get_first(void);
-int virtcrypto_dev_in_use(struct virtio_crypto *vcrypto_dev);
 int virtcrypto_dev_get(struct virtio_crypto *vcrypto_dev);
 void virtcrypto_dev_put(struct virtio_crypto *vcrypto_dev);
 int virtcrypto_dev_started(struct virtio_crypto *vcrypto_dev);
diff --git a/drivers/crypto/virtio/virtio_crypto_mgr.c b/drivers/crypto/virtio/virtio_crypto_mgr.c
index bddbd8ebfebe..06c74fa132cd 100644
--- a/drivers/crypto/virtio/virtio_crypto_mgr.c
+++ b/drivers/crypto/virtio/virtio_crypto_mgr.c
@@ -81,42 +81,6 @@ void virtcrypto_devmgr_rm_dev(struct virtio_crypto *vcrypto_dev)
 	mutex_unlock(&table_lock);
 }
 
-/*
- * virtcrypto_devmgr_get_first()
- *
- * Function returns the first virtio crypto device from the acceleration
- * framework.
- *
- * To be used by virtio crypto device specific drivers.
- *
- * Return: pointer to vcrypto_dev or NULL if not found.
- */
-struct virtio_crypto *virtcrypto_devmgr_get_first(void)
-{
-	struct virtio_crypto *dev = NULL;
-
-	mutex_lock(&table_lock);
-	if (!list_empty(&virtio_crypto_table))
-		dev = list_first_entry(&virtio_crypto_table,
-					struct virtio_crypto,
-				    list);
-	mutex_unlock(&table_lock);
-	return dev;
-}
-
-/*
- * virtcrypto_dev_in_use() - Check whether vcrypto_dev is currently in use
- * @vcrypto_dev: Pointer to virtio crypto device.
- *
- * To be used by virtio crypto device specific drivers.
- *
- * Return: 1 when device is in use, 0 otherwise.
- */
-int virtcrypto_dev_in_use(struct virtio_crypto *vcrypto_dev)
-{
-	return atomic_read(&vcrypto_dev->ref_count) != 0;
-}
-
 /*
  * virtcrypto_dev_get() - Increment vcrypto_dev reference count
  * @vcrypto_dev: Pointer to virtio crypto device.
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-crypto: Remove unused virtcrypto functions
  2025-06-14  0:05 [PATCH] virtio-crypto: Remove unused virtcrypto functions linux
@ 2025-06-16  2:51 ` Zenghui Yu
  2025-06-23  9:20 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Zenghui Yu @ 2025-06-16  2:51 UTC (permalink / raw)
  To: linux
  Cc: arei.gonglei, mst, jasowang, xuanzhuo, eperezma, herbert, davem,
	virtualization, linux-crypto, linux-kernel

On 2025/6/14 8:05, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> virtcrypto_devmgr_get_first() and virtcrypto_dev_in_use() were added in
> 2016 by
> commit dbaf0624ffa5 ("crypto: add virtio-crypto driver")
> 
> but have remained unused.
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>  drivers/crypto/virtio/virtio_crypto_common.h |  2 --
>  drivers/crypto/virtio/virtio_crypto_mgr.c    | 36 --------------------
>  2 files changed, 38 deletions(-)

Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-crypto: Remove unused virtcrypto functions
  2025-06-14  0:05 [PATCH] virtio-crypto: Remove unused virtcrypto functions linux
  2025-06-16  2:51 ` Zenghui Yu
@ 2025-06-23  9:20 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2025-06-23  9:20 UTC (permalink / raw)
  To: linux
  Cc: arei.gonglei, mst, jasowang, xuanzhuo, eperezma, davem,
	virtualization, linux-crypto, linux-kernel

On Sat, Jun 14, 2025 at 01:05:05AM +0100, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> virtcrypto_devmgr_get_first() and virtcrypto_dev_in_use() were added in
> 2016 by
> commit dbaf0624ffa5 ("crypto: add virtio-crypto driver")
> 
> but have remained unused.
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>  drivers/crypto/virtio/virtio_crypto_common.h |  2 --
>  drivers/crypto/virtio/virtio_crypto_mgr.c    | 36 --------------------
>  2 files changed, 38 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-23  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-14  0:05 [PATCH] virtio-crypto: Remove unused virtcrypto functions linux
2025-06-16  2:51 ` Zenghui Yu
2025-06-23  9:20 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox