Thread (2 messages) 2 messages, 2 authors, 2021-04-09
STALE1889d

[PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock

From: Tang Yizhou <hidden>
Date: 2021-03-31 01:44:34
Also in: kernel-janitors, lkml
Subsystem: amd cryptographic coprocessor (ccp) driver, crypto api, the rest · Maintainers: Tom Lendacky, John Allen, Herbert Xu, "David S. Miller", Linus Torvalds

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

Reported-by: Hulk Robot <redacted>
Signed-off-by: Tang Yizhou <redacted>
---
 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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help