* [PATCH -next] IB/rxe: Use DEFINE_SPINLOCK() for spinlock
@ 2016-10-29 16:19 Wei Yongjun
[not found] ` <1477757973-32052-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Wei Yongjun @ 2016-10-29 16:19 UTC (permalink / raw)
To: Moni Shoua, Doug Ledford, Sean Hefty, Hal Rosenstock
Cc: Wei Yongjun, linux-rdma-u79uwXL29TY76Z2rM5mHXA
From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
drivers/infiniband/sw/rxe/rxe_net.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index b8258e4..4cb6378 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -46,7 +46,7 @@
#include "rxe_loc.h"
static LIST_HEAD(rxe_dev_list);
-static spinlock_t dev_list_lock; /* spinlock for device list */
+static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */
struct rxe_dev *net_to_rxe(struct net_device *ndev)
{
@@ -663,8 +663,6 @@ struct notifier_block rxe_net_notifier = {
int rxe_net_ipv4_init(void)
{
- spin_lock_init(&dev_list_lock);
-
recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), false);
if (IS_ERR(recv_sockets.sk4)) {
@@ -680,8 +678,6 @@ int rxe_net_ipv6_init(void)
{
#if IS_ENABLED(CONFIG_IPV6)
- spin_lock_init(&dev_list_lock);
-
recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), true);
if (IS_ERR(recv_sockets.sk6)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1477757973-32052-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH -next] IB/rxe: Use DEFINE_SPINLOCK() for spinlock [not found] ` <1477757973-32052-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2016-10-30 21:09 ` Leon Romanovsky 2016-11-06 10:05 ` Moni Shoua 1 sibling, 0 replies; 4+ messages in thread From: Leon Romanovsky @ 2016-10-30 21:09 UTC (permalink / raw) To: Wei Yongjun Cc: Moni Shoua, Doug Ledford, Sean Hefty, Hal Rosenstock, Wei Yongjun, linux-rdma-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1791 bytes --] On Sat, Oct 29, 2016 at 04:19:33PM +0000, Wei Yongjun wrote: > From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> > > spinlock can be initialized automatically with DEFINE_SPINLOCK() > rather than explicitly calling spin_lock_init(). > > Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Thanks. Reviewed-by: Leon Romanosky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > --- > drivers/infiniband/sw/rxe/rxe_net.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c > index b8258e4..4cb6378 100644 > --- a/drivers/infiniband/sw/rxe/rxe_net.c > +++ b/drivers/infiniband/sw/rxe/rxe_net.c > @@ -46,7 +46,7 @@ > #include "rxe_loc.h" > > static LIST_HEAD(rxe_dev_list); > -static spinlock_t dev_list_lock; /* spinlock for device list */ > +static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */ > > struct rxe_dev *net_to_rxe(struct net_device *ndev) > { > @@ -663,8 +663,6 @@ struct notifier_block rxe_net_notifier = { > > int rxe_net_ipv4_init(void) > { > - spin_lock_init(&dev_list_lock); > - > recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, > htons(ROCE_V2_UDP_DPORT), false); > if (IS_ERR(recv_sockets.sk4)) { > @@ -680,8 +678,6 @@ int rxe_net_ipv6_init(void) > { > #if IS_ENABLED(CONFIG_IPV6) > > - spin_lock_init(&dev_list_lock); > - > recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, > htons(ROCE_V2_UDP_DPORT), true); > if (IS_ERR(recv_sockets.sk6)) { > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] IB/rxe: Use DEFINE_SPINLOCK() for spinlock [not found] ` <1477757973-32052-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2016-10-30 21:09 ` Leon Romanovsky @ 2016-11-06 10:05 ` Moni Shoua [not found] ` <CAG9sBKPfW9uBAKN8r4tRHyzP9NSoEnhpwSwH9QBiVbq2k+a6gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 1 sibling, 1 reply; 4+ messages in thread From: Moni Shoua @ 2016-11-06 10:05 UTC (permalink / raw) To: Wei Yongjun Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, Wei Yongjun, linux-rdma On Sat, Oct 29, 2016 at 6:19 PM, Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> > > spinlock can be initialized automatically with DEFINE_SPINLOCK() > rather than explicitly calling spin_lock_init(). > > Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> > --- > drivers/infiniband/sw/rxe/rxe_net.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c > index b8258e4..4cb6378 100644 > --- a/drivers/infiniband/sw/rxe/rxe_net.c > +++ b/drivers/infiniband/sw/rxe/rxe_net.c > @@ -46,7 +46,7 @@ > #include "rxe_loc.h" > > static LIST_HEAD(rxe_dev_list); > -static spinlock_t dev_list_lock; /* spinlock for device list */ > +static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */ > > struct rxe_dev *net_to_rxe(struct net_device *ndev) > { > @@ -663,8 +663,6 @@ struct notifier_block rxe_net_notifier = { > > int rxe_net_ipv4_init(void) > { > - spin_lock_init(&dev_list_lock); > - > recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, > htons(ROCE_V2_UDP_DPORT), false); > if (IS_ERR(recv_sockets.sk4)) { > @@ -680,8 +678,6 @@ int rxe_net_ipv6_init(void) > { > #if IS_ENABLED(CONFIG_IPV6) > > - spin_lock_init(&dev_list_lock); > - > recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, > htons(ROCE_V2_UDP_DPORT), true); > if (IS_ERR(recv_sockets.sk6)) { > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Thanks -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CAG9sBKPfW9uBAKN8r4tRHyzP9NSoEnhpwSwH9QBiVbq2k+a6gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH -next] IB/rxe: Use DEFINE_SPINLOCK() for spinlock [not found] ` <CAG9sBKPfW9uBAKN8r4tRHyzP9NSoEnhpwSwH9QBiVbq2k+a6gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2016-12-12 21:36 ` Doug Ledford 0 siblings, 0 replies; 4+ messages in thread From: Doug Ledford @ 2016-12-12 21:36 UTC (permalink / raw) To: Moni Shoua, Wei Yongjun Cc: Sean Hefty, Hal Rosenstock, Wei Yongjun, linux-rdma [-- Attachment #1.1: Type: text/plain, Size: 448 bytes --] On 11/6/2016 5:05 AM, Moni Shoua wrote: > From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> > > spinlock can be initialized automatically with DEFINE_SPINLOCK() > rather than explicitly calling spin_lock_init(). > > Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Thanks, applied. -- Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG Key ID: 0E572FDD [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 884 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-12 21:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-29 16:19 [PATCH -next] IB/rxe: Use DEFINE_SPINLOCK() for spinlock Wei Yongjun
[not found] ` <1477757973-32052-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-30 21:09 ` Leon Romanovsky
2016-11-06 10:05 ` Moni Shoua
[not found] ` <CAG9sBKPfW9uBAKN8r4tRHyzP9NSoEnhpwSwH9QBiVbq2k+a6gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-12 21:36 ` Doug Ledford
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).