Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1391807
| From | Muhammad Falak R Wani <falakreyaz@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing. |
| Date | 2016-05-01 15:00 +0200 |
| Message-ID | <rtZ8C-1fy-5@gated-at.bofh.it> (permalink) |
| References | <rtZ8C-1fy-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing. Muhammad Falak R Wani <falakreyaz@gmail.com> - 2016-05-01 15:00 +0200
csiph-web