diff options
author | Andreea-Cristina Bernat <bernat.ada@gmail.com> | 2014-08-27 16:27:30 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-08-28 14:50:13 -0400 |
commit | 6a5d088a923854569e20eac4f3f569926d5911ec (patch) | |
tree | b3ce027b9dc733425722447847c97563d7ab477a /net/rxrpc/af_rxrpc.c | |
parent | 1a7c5b7ef0cf93b42b9181973ce283fe77fb6093 (diff) | |
download | blackbird-op-linux-6a5d088a923854569e20eac4f3f569926d5911ec.tar.gz blackbird-op-linux-6a5d088a923854569e20eac4f3f569926d5911ec.zip |
carl9170: tx: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
According to RCU_INIT_POINTER()'s block comment 3.a, it can be used if
"3. The referenced data structure has already been exposed to readers either
at compile time or via rcu_assign_pointer() -and-
a. You have not made -any- reader-visible changes to this structure since
then".
This case fulfills the conditions above because between the rcu_dereference()
call (cvif = rcu_dereference(ar->beacon_iter);) and the rcu_assign_pointer()
call there is no update of the "cvif" variable.
Therefore, this patch makes the replacement.
The following Coccinelle semantic patch was used:
@@
identifier v;
@@
v = rcu_dereference(...);
... when != rcu_dereference(...);
when != v = ...;
when != (<+...v...+>)++;
when != \(memcpy\|memset\)(...);
(
- rcu_assign_pointer
+ RCU_INIT_POINTER
(..., v);
|
if(...) {
... when != v = ...;
- rcu_assign_pointer
+ RCU_INIT_POINTER
(..., v);
... when any
}
)
Because there are cases where between a “rcu_dereference()” call and a
“rcu_assign_pointer()” call might be updates of the value that interests us,
the Coccinelle semantic patch ignores them and replaces with
"RCU_INIT_POINTER()" only when the update is not happening.
Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/rxrpc/af_rxrpc.c')
0 files changed, 0 insertions, 0 deletions