diff mbox series

[-next] crypto: geode -: use DEFINE_SPINLOCK() for spinlock

Message ID 1617710403-48471-1-git-send-email-huangguobin4@huawei.com
State Accepted
Commit 25ee76a221b01c4044fbcfe0b8cfd3d4f5982f2b
Headers show
Series [-next] crypto: geode -: use DEFINE_SPINLOCK() for spinlock | expand

Commit Message

Huang Guobin April 6, 2021, noon UTC
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/geode-aes.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Herbert Xu April 16, 2021, 11:29 a.m. UTC | #1
On Tue, Apr 06, 2021 at 08:00:03PM +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/geode-aes.c | 4 +---

>  1 file changed, 1 insertion(+), 3 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
diff mbox series

Patch

diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 4ee010f39912..fa5a9f207bc9 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -21,7 +21,7 @@ 
 /* Static structures */
 
 static void __iomem *_iobase;
-static spinlock_t lock;
+static DEFINE_SPINLOCK(lock);
 
 /* Write a 128 bit field (either a writable key or IV) */
 static inline void
@@ -383,8 +383,6 @@  static int geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		goto erequest;
 	}
 
-	spin_lock_init(&lock);
-
 	/* Clear any pending activity */
 	iowrite32(AES_INTR_PENDING | AES_INTR_MASK, _iobase + AES_INTR_REG);