Skip to content

Commit

Permalink
crypto: ccp - Use DEFINE_SPINLOCK() for spinlock
Browse files Browse the repository at this point in the history
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Tang Yizhou <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Tang Yizhou authored and herbertx committed Apr 9, 2021
1 parent fd4317b commit 63655b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/crypto/ccp/ccp-crypto-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 63655b6

Please sign in to comment.