* [PATCH] mac80211: scan: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
@ 2014-08-22 13:14 Andreea-Cristina Bernat
2014-08-26 9:16 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Andreea-Cristina Bernat @ 2014-08-22 13:14 UTC (permalink / raw)
To: linville, johannes, davem, linux-wireless, netdev, linux-kernel; +Cc: paulmck
The use of "rcu_assign_pointer()" is NULLing out the pointer.
According to RCU_INIT_POINTER()'s block comment:
"1. This use of RCU_INIT_POINTER() is NULLing out the pointer"
it is better to use it instead of rcu_assign_pointer() because it has a
smaller overhead.
The following Coccinelle semantic patch was used:
@@
@@
- rcu_assign_pointer
+ RCU_INIT_POINTER
(..., NULL)
Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
---
net/mac80211/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index f40661e..6c69d09 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -1058,7 +1058,7 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata)
if (rcu_access_pointer(local->sched_scan_sdata)) {
ret = drv_sched_scan_stop(local, sdata);
if (!ret)
- rcu_assign_pointer(local->sched_scan_sdata, NULL);
+ RCU_INIT_POINTER(local->sched_scan_sdata, NULL);
}
out:
mutex_unlock(&local->mtx);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mac80211: scan: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
2014-08-22 13:14 [PATCH] mac80211: scan: Replace rcu_assign_pointer() with RCU_INIT_POINTER() Andreea-Cristina Bernat
@ 2014-08-26 9:16 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2014-08-26 9:16 UTC (permalink / raw)
To: Andreea-Cristina Bernat
Cc: linville, davem, linux-wireless, netdev, linux-kernel, paulmck
On Fri, 2014-08-22 at 16:14 +0300, Andreea-Cristina Bernat wrote:
> The use of "rcu_assign_pointer()" is NULLing out the pointer.
> According to RCU_INIT_POINTER()'s block comment:
> "1. This use of RCU_INIT_POINTER() is NULLing out the pointer"
> it is better to use it instead of rcu_assign_pointer() because it has a
> smaller overhead.
Applied, thanks.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-26 9:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 13:14 [PATCH] mac80211: scan: Replace rcu_assign_pointer() with RCU_INIT_POINTER() Andreea-Cristina Bernat
2014-08-26 9:16 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.