linux/drivers/net/wireless/ath/carl9170
Andreea-Cristina Bernat 6a5d088a92 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>
2014-08-28 14:50:13 -04:00
..
carl9170.h carl9170: fix sending URBs with wrong type when using full-speed 2014-08-11 14:43:51 -04:00
cmd.c wireless: Remove casts to same type 2012-06-06 09:31:33 -07:00
cmd.h
debug.c wireless: delete non-required instances of include <linux/init.h> 2014-01-03 15:37:01 -05:00
debug.h
eeprom.h
fw.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2013-01-28 13:54:03 -05:00
fwcmd.h carl9170: import 1.9.7 firmware headers 2013-01-07 15:16:51 -05:00
fwdesc.h carl9170: import 1.9.6 firmware headers 2012-07-11 15:38:26 -04:00
hw.h carl9170: import 1.9.7 firmware headers 2013-01-07 15:16:51 -05:00
Kconfig drivers/net/wireless/ath/carl9170: remove depends on CONFIG_EXPERIMENTAL 2013-01-22 12:01:35 -08:00
led.c
mac.c mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chan 2013-03-25 19:19:35 +01:00
main.c carl9170: Remove redundant protection check 2014-08-28 14:49:35 -04:00
Makefile
phy.c carl9170: remove unnecessary break after return 2014-07-20 21:29:51 -07:00
phy.h
rx.c carl9170: Remove casts of pointer to same type 2014-03-27 14:20:05 -04:00
tx.c carl9170: tx: Replace rcu_assign_pointer() with RCU_INIT_POINTER() 2014-08-28 14:50:13 -04:00
usb.c carl9170: fix sending URBs with wrong type when using full-speed 2014-08-11 14:43:51 -04:00
version.h carl9170: import 1.9.7 firmware headers 2013-01-07 15:16:51 -05:00
wlan.h