From: Muhammad Falak R Wani <falakreyaz@gmail.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: target-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] target: use RCU_INIT_POINTER() when NULLing.
Date: Sun, 1 May 2016 18:22:02 +0530 [thread overview]
Message-ID: <1462107122-9562-2-git-send-email-falakreyaz@gmail.com> (raw)
In-Reply-To: <1462107122-9562-1-git-send-email-falakreyaz@gmail.com>
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
next prev parent reply other threads:[~2016-05-01 12:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-01 12:52 [PATCH 2/2] " Muhammad Falak R Wani
2016-05-01 12:52 ` Muhammad Falak R Wani [this message]
2016-05-01 17:01 ` Christoph Hellwig
2016-05-01 19:53 ` Paul E. McKenney
2016-05-02 14:10 ` Paul E. McKenney
2016-05-02 17:57 ` Paul E. McKenney
2016-05-02 17:59 ` Christoph Hellwig
2016-05-02 18:06 ` Paul E. McKenney
2016-05-03 8:45 ` Christoph Hellwig
2016-05-03 13:07 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462107122-9562-2-git-send-email-falakreyaz@gmail.com \
--to=falakreyaz@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®