Commit 841081d8 authored by Zheng Yongjun's avatar Zheng Yongjun Committed by Greg Kroah-Hartman
Browse files

usb: usbip: Use DEFINE_SPINLOCK() for spinlock



spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20201223141431.835-1-zhengyongjun3@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d7aae9f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ struct kmem_cache *stub_priv_cache;
 */
#define MAX_BUSID 16
static struct bus_id_priv busid_table[MAX_BUSID];
static spinlock_t busid_table_lock;
static DEFINE_SPINLOCK(busid_table_lock);

static void init_busid_table(void)
{
@@ -35,8 +35,6 @@ static void init_busid_table(void)
	 */
	memset(busid_table, 0, sizeof(busid_table));

	spin_lock_init(&busid_table_lock);

	for (i = 0; i < MAX_BUSID; i++)
		spin_lock_init(&busid_table[i].busid_lock);
}