linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing.
@ 2016-05-01 12:35 Muhammad Falak R Wani
  2016-05-02  5:27 ` Leon Romanovsky
  2016-05-13 19:38 ` Doug Ledford
  0 siblings, 2 replies; 3+ messages in thread
From: Muhammad Falak R Wani @ 2016-05-01 12:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mike Marciniszyn, Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma, devel, linux-kernel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-13 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-01 12:35 [PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing Muhammad Falak R Wani
2016-05-02  5:27 ` Leon Romanovsky
2016-05-13 19:38 ` 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).