diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-10-29 12:19:33 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-12 16:31:45 -0500 |
commit | 4ac4707102d9ea1ffc9b5735891f6c5ee3d236e5 (patch) | |
tree | 7e6596290663334bf3a0639a749e7cf60d452b3f /drivers/infiniband/sw | |
parent | a0fa72683e78979ef1123d679b1c40ae28bd9096 (diff) |
IB/rxe: Use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Leon Romanosky <leonro@mellanox.com>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r-- | drivers/infiniband/sw/rxe/rxe_net.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index b8258e4f0aea..4cb63780fa74 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "rxe_loc.h" | 46 | #include "rxe_loc.h" |
47 | 47 | ||
48 | static LIST_HEAD(rxe_dev_list); | 48 | static LIST_HEAD(rxe_dev_list); |
49 | static spinlock_t dev_list_lock; /* spinlock for device list */ | 49 | static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */ |
50 | 50 | ||
51 | struct rxe_dev *net_to_rxe(struct net_device *ndev) | 51 | struct rxe_dev *net_to_rxe(struct net_device *ndev) |
52 | { | 52 | { |
@@ -663,8 +663,6 @@ struct notifier_block rxe_net_notifier = { | |||
663 | 663 | ||
664 | int rxe_net_ipv4_init(void) | 664 | int rxe_net_ipv4_init(void) |
665 | { | 665 | { |
666 | spin_lock_init(&dev_list_lock); | ||
667 | |||
668 | recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, | 666 | recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, |
669 | htons(ROCE_V2_UDP_DPORT), false); | 667 | htons(ROCE_V2_UDP_DPORT), false); |
670 | if (IS_ERR(recv_sockets.sk4)) { | 668 | if (IS_ERR(recv_sockets.sk4)) { |
@@ -680,8 +678,6 @@ int rxe_net_ipv6_init(void) | |||
680 | { | 678 | { |
681 | #if IS_ENABLED(CONFIG_IPV6) | 679 | #if IS_ENABLED(CONFIG_IPV6) |
682 | 680 | ||
683 | spin_lock_init(&dev_list_lock); | ||
684 | |||
685 | recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, | 681 | recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, |
686 | htons(ROCE_V2_UDP_DPORT), true); | 682 | htons(ROCE_V2_UDP_DPORT), true); |
687 | if (IS_ERR(recv_sockets.sk6)) { | 683 | if (IS_ERR(recv_sockets.sk6)) { |