projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d7aae9
)
usb: usbip: Use DEFINE_SPINLOCK() for spinlock
author
Zheng Yongjun
<zhengyongjun3@huawei.com>
Wed, 23 Dec 2020 14:14:31 +0000
(22:14 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 7 Jan 2021 13:34:24 +0000
(14:34 +0100)
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link:
https://lore.kernel.org/r/20201223141431.835-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/stub_main.c
patch
|
blob
|
history
diff --git
a/drivers/usb/usbip/stub_main.c
b/drivers/usb/usbip/stub_main.c
index c1c0bbc9f8b17a6e18f681dddc9937eb02a87778..77a5b3f8736af1e760a807894da0f5b2a0c9cbbb 100644
(file)
--- a/
drivers/usb/usbip/stub_main.c
+++ b/
drivers/usb/usbip/stub_main.c
@@
-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);
}