crypto: ccp - Use DEFINE_SPINLOCK() for spinlock
authorTang Yizhou <tangyizhou@huawei.com>
Wed, 31 Mar 2021 02:00:55 +0000 (10:00 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Apr 2021 07:41:06 +0000 (17:41 +1000)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-crypto-main.c

index 88275b4..5976530 100644 (file)
@@ -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;