* [PATCH -next] driver: aoe: use DEFINE_SPINLOCK() for spinlock
@ 2021-04-02 7:33 Zucheng Zheng
0 siblings, 0 replies; only message in thread
From: Zucheng Zheng @ 2021-04-02 7:33 UTC (permalink / raw)
To: justin, axboe; +Cc: linux-block, linux-kernel, hucool.lihua
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: Zucheng Zheng <zhengzucheng@huawei.com>
---
drivers/block/aoe/aoenet.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 63773a90581d..46cce83c155d 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -47,7 +47,7 @@ static int __init aoe_iflist_setup(char *str)
__setup("aoe_iflist=", aoe_iflist_setup);
#endif
-static spinlock_t txlock;
+static DEFINE_SPINLOCK(txlock);
static struct sk_buff_head skbtxq;
/* enters with txlock held */
@@ -201,7 +201,6 @@ aoenet_init(void)
{
skb_queue_head_init(&skbtxq);
init_waitqueue_head(&txwq);
- spin_lock_init(&txlock);
kts.lock = &txlock;
kts.fn = tx;
kts.waitq = &txwq;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-02 7:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 7:33 [PATCH -next] driver: aoe: use DEFINE_SPINLOCK() for spinlock Zucheng Zheng
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).