Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp44513pxf; Tue, 30 Mar 2021 18:45:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd4x8LCaNSGBYoy7ho5sxNs2OfSkXKYz96iOo1Rl41p9AqlKax+m8sTKcvoMIIq8L0+XaB X-Received: by 2002:a50:ec07:: with SMTP id g7mr824341edr.72.1617155109946; Tue, 30 Mar 2021 18:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617155109; cv=none; d=google.com; s=arc-20160816; b=JFbbeIzD7Iz2g8M5qho42tk1ZX6v60pJ8A8V6K5C/DfQUPD+dLrrVHxTpZCRfeQKFP Y2zIYR3XiWOcY9D3uhQxLxE2NulTsTzIN9FM/24coZgeiQGoqefdkzSabFCF2WGntWTb 4SpllM/zsgtkKCI7YFVnMimp/oV7P3ZTtOsIt1WSUv4JixugqxRRo57/CfN/AH/ruo3q HkXJnoPW8IDoi6jRUKJRpvXfYaREcrfHJKnqzqEa5TiLEmzFzYdCVwG7CZd+2sPe/507 jxzXmXeMbjEiI9qJhyyDQ5Orfx3Zs0a7231rJleLLGKjwWs+xmPFs+BdhNK9dtxJ8+GA yyQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WQ3uyS2wIXFbVwSoh2N2r9hq0Tl9C4bjEnt3A7khTuc=; b=gBk+kqCgz08c86pQ5jEjnPc0P0LbwT7qTyMfQZ0h25zQ9HIAC9GdGt69odclwJLjS6 Tmrw2Lay0pFTT8ryObLQiFMf3P8YzADflR6zeimspDXMlEGHluV6YFqLfzi7XU+HmQYK eBgmOF0wEGKlf0Gw43wsM5jD2U4RYgD9slj/7DOMwkFVCgT9ly2T0tVM4n4uUq2kLqF4 k5I9e5lj2kNnkO1vB2NTbxiQo/to42kfn7Bjf+WXtuFpf9+YcJjED9ZPuy17LXOrnPm1 F1RB1UIzXhAy36uTm94In5+x7LUA5j7fFLoRSWI6KnE2InRjwEcMVpOhY3jVWRClwy4W Mi/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si505447edd.567.2021.03.30.18.44.34; Tue, 30 Mar 2021 18:45:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbhCaBoA (ORCPT + 99 others); Tue, 30 Mar 2021 21:44:00 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15109 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhCaBna (ORCPT ); Tue, 30 Mar 2021 21:43:30 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F98DL3NR9z19K7t; Wed, 31 Mar 2021 09:41:22 +0800 (CST) Received: from ubuntu180.huawei.com (10.175.100.227) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Wed, 31 Mar 2021 09:43:17 +0800 From: Tang Yizhou To: , Tom Lendacky , "John Allen" , Herbert Xu CC: , , , Hulk Robot Subject: [PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock Date: Wed, 31 Mar 2021 10:00:55 +0800 Message-ID: <20210331020055.4631-1-tangyizhou@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.100.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot Signed-off-by: Tang Yizhou --- 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;