linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock
@ 2021-03-31  2:00 Tang Yizhou
  2021-04-09  7:52 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Tang Yizhou @ 2021-03-31  2:00 UTC (permalink / raw)
  To: tangyizhou, Tom Lendacky, John Allen, Herbert Xu
  Cc: linux-crypto, linux-kernel, kernel-janitors, Hulk Robot

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
---
 drivers/crypto/ccp/ccp-crypto-main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/ccp/ccp-crypto-main.c b/drivers/crypto/ccp/ccp-crypto-main.c
index 88275b4867ea..5976530c00a8 100644
--- a/drivers/crypto/ccp/ccp-crypto-main.c
+++ b/drivers/crypto/ccp/ccp-crypto-main.c
@@ -59,7 +59,7 @@ struct ccp_crypto_queue {
 #define CCP_CRYPTO_MAX_QLEN	100
 
 static struct ccp_crypto_queue req_queue;
-static spinlock_t req_queue_lock;
+static DEFINE_SPINLOCK(req_queue_lock);
 
 struct ccp_crypto_cmd {
 	struct list_head entry;
@@ -410,7 +410,6 @@ static int ccp_crypto_init(void)
 		return ret;
 	}
 
-	spin_lock_init(&req_queue_lock);
 	INIT_LIST_HEAD(&req_queue.cmds);
 	req_queue.backlog = &req_queue.cmds;
 	req_queue.cmd_count = 0;


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

* Re: [PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock
  2021-03-31  2:00 [PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock Tang Yizhou
@ 2021-04-09  7:52 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-04-09  7:52 UTC (permalink / raw)
  To: Tang Yizhou
  Cc: Tom Lendacky, John Allen, linux-crypto, linux-kernel,
	kernel-janitors, Hulk Robot

On Wed, Mar 31, 2021 at 10:00:55AM +0800, Tang Yizhou wrote:
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
> ---
>  drivers/crypto/ccp/ccp-crypto-main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 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] 2+ messages in thread

end of thread, other threads:[~2021-04-09  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31  2:00 [PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock Tang Yizhou
2021-04-09  7:52 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).