Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391807 > unrolled thread

[PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing.

Started byMuhammad Falak R Wani <falakreyaz@gmail.com>
First post2016-05-01 15:00 +0200
Last post2016-05-01 15:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing. Muhammad Falak R Wani <falakreyaz@gmail.com> - 2016-05-01 15:00 +0200

#1391807 — [PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing.

FromMuhammad Falak R Wani <falakreyaz@gmail.com>
Date2016-05-01 15:00 +0200
Subject[PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing.
Message-ID<rtZ8C-1fy-5@gated-at.bofh.it>
It is safe to use RCU_INIT_POINTER() to NULL, instead of
rcu_assign_pointer().
This results in slightly smaller/faster code.

The follwoing semantic patch was used:
<smpl>
@@
@@
- rcu_assign_pointer
+ RCU_INIT_POINTER
  (..., NULL)

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
 drivers/target/target_core_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index a4046ca..6f81e3b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -432,8 +432,8 @@ void core_disable_device_list_for_node(
 	kref_put(&orig->pr_kref, target_pr_kref_release);
 	wait_for_completion(&orig->pr_comp);
 
-	rcu_assign_pointer(orig->se_lun, NULL);
-	rcu_assign_pointer(orig->se_lun_acl, NULL);
+	RCU_INIT_POINTER(orig->se_lun, NULL);
+	RCU_INIT_POINTER(orig->se_lun_acl, NULL);
 
 	kfree_rcu(orig, rcu_head);
 
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web