* [PATCH -next] crypto: ixp4xx -: use DEFINE_SPINLOCK() for spinlock
@ 2021-04-06 12:02 Huang Guobin
2021-04-16 11:29 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Huang Guobin @ 2021-04-06 12:02 UTC (permalink / raw)
To: huangguobin4, Herbert Xu, David S. Miller; +Cc: linux-crypto, linux-kernel
From: Guobin Huang <huangguobin4@huawei.com>
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: Guobin Huang <huangguobin4@huawei.com>
---
drivers/crypto/ixp4xx_crypto.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index 8b0f17fc09fb..0616e369522e 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -265,7 +265,7 @@ static int setup_crypt_desc(void)
return 0;
}
-static spinlock_t desc_lock;
+static DEFINE_SPINLOCK(desc_lock);
static struct crypt_ctl *get_crypt_desc(void)
{
int i;
@@ -293,7 +293,7 @@ static struct crypt_ctl *get_crypt_desc(void)
}
}
-static spinlock_t emerg_lock;
+static DEFINE_SPINLOCK(emerg_lock);
static struct crypt_ctl *get_crypt_desc_emerg(void)
{
int i;
@@ -1379,9 +1379,6 @@ static int __init ixp_module_init(void)
if (IS_ERR(pdev))
return PTR_ERR(pdev);
- spin_lock_init(&desc_lock);
- spin_lock_init(&emerg_lock);
-
err = init_ixp_crypto(&pdev->dev);
if (err) {
platform_device_unregister(pdev);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] crypto: ixp4xx -: use DEFINE_SPINLOCK() for spinlock
2021-04-06 12:02 [PATCH -next] crypto: ixp4xx -: use DEFINE_SPINLOCK() for spinlock Huang Guobin
@ 2021-04-16 11:29 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-04-16 11:29 UTC (permalink / raw)
To: Huang Guobin; +Cc: David S. Miller, linux-crypto, linux-kernel
On Tue, Apr 06, 2021 at 08:02:57PM +0800, Huang Guobin wrote:
> From: Guobin Huang <huangguobin4@huawei.com>
>
> 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: Guobin Huang <huangguobin4@huawei.com>
> ---
> drivers/crypto/ixp4xx_crypto.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 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-16 11:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 12:02 [PATCH -next] crypto: ixp4xx -: use DEFINE_SPINLOCK() for spinlock Huang Guobin
2021-04-16 11:29 ` 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).