Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1391805 > unrolled thread
| Started by | Muhammad Falak R Wani <falakreyaz@gmail.com> |
|---|---|
| First post | 2016-05-01 14:40 +0200 |
| Last post | 2016-05-02 07:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing. Muhammad Falak R Wani <falakreyaz@gmail.com> - 2016-05-01 14:40 +0200
Re: [PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing. Leon Romanovsky <leon@kernel.org> - 2016-05-02 07:30 +0200
| From | Muhammad Falak R Wani <falakreyaz@gmail.com> |
|---|---|
| Date | 2016-05-01 14:40 +0200 |
| Subject | [PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing. |
| Message-ID | <rtYPf-18i-7@gated-at.bofh.it> |
It is safe to use RCU_INIT_POINTER() to NULL a pointer, instead of rcu_assign_pointer(). This results in slightly smaller/faster code. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> --- drivers/staging/rdma/hfi1/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c index cfcdc16..34e0f90 100644 --- a/drivers/staging/rdma/hfi1/init.c +++ b/drivers/staging/rdma/hfi1/init.c @@ -1303,7 +1303,7 @@ static void cleanup_device_data(struct hfi1_devdata *dd) spin_lock(&ppd->cc_state_lock); cc_state = get_cc_state(ppd); - rcu_assign_pointer(ppd->cc_state, NULL); + RCU_INIT_POINTER(ppd->cc_state, NULL); spin_unlock(&ppd->cc_state_lock); if (cc_state) -- 1.9.1
[toc] | [next] | [standalone]
| From | Leon Romanovsky <leon@kernel.org> |
|---|---|
| Date | 2016-05-02 07:30 +0200 |
| Message-ID | <rueAG-63I-11@gated-at.bofh.it> |
| In reply to | #1391805 |
[Multipart message — attachments visible in raw view] — view raw
On Sun, May 01, 2016 at 06:05:31PM +0530, Muhammad Falak R Wani wrote: > It is safe to use RCU_INIT_POINTER() to NULL a pointer, instead of > rcu_assign_pointer(). > This results in slightly smaller/faster code. > > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> I'm fine with your commit message and don't need to resend, however the statements like "smaller code" need to be supported by ./scripts/bloat-o-meter and "faster code" by performance analysis. Reviewed-by: Leon Romanovsky <leonro@mellanox.com> > --- > drivers/staging/rdma/hfi1/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c > index cfcdc16..34e0f90 100644 > --- a/drivers/staging/rdma/hfi1/init.c > +++ b/drivers/staging/rdma/hfi1/init.c > @@ -1303,7 +1303,7 @@ static void cleanup_device_data(struct hfi1_devdata *dd) > > spin_lock(&ppd->cc_state_lock); > cc_state = get_cc_state(ppd); > - rcu_assign_pointer(ppd->cc_state, NULL); > + RCU_INIT_POINTER(ppd->cc_state, NULL); > spin_unlock(&ppd->cc_state_lock); > > if (cc_state) > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web