Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ixp4xx - use DEFINE_SPINLOCK() for spinlock

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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Guobin Huang and committed by
Herbert Xu
7dad7d00 25ee76a2

+2 -5
+2 -5
drivers/crypto/ixp4xx_crypto.c
··· 265 265 return 0; 266 266 } 267 267 268 - static spinlock_t desc_lock; 268 + static DEFINE_SPINLOCK(desc_lock); 269 269 static struct crypt_ctl *get_crypt_desc(void) 270 270 { 271 271 int i; ··· 293 293 } 294 294 } 295 295 296 - static spinlock_t emerg_lock; 296 + static DEFINE_SPINLOCK(emerg_lock); 297 297 static struct crypt_ctl *get_crypt_desc_emerg(void) 298 298 { 299 299 int i; ··· 1378 1378 pdev = platform_device_register_full(&ixp_dev_info); 1379 1379 if (IS_ERR(pdev)) 1380 1380 return PTR_ERR(pdev); 1381 - 1382 - spin_lock_init(&desc_lock); 1383 - spin_lock_init(&emerg_lock); 1384 1381 1385 1382 err = init_ixp_crypto(&pdev->dev); 1386 1383 if (err) {