summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-11-23 07:09:32 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-23 18:48:19 -0500
commit2cfa5a0471fef43fda0b7bd87e3a5e4dbadb7809 (patch)
tree0603cf740823a45337e2b82ba63bae96a6e75186 /net/core
parent8c2152286aabe753519d7627a2992625b97e4b20 (diff)
net: treewide use of RCU_INIT_POINTER
rcu_assign_pointer(ptr, NULL) can be safely replaced by RCU_INIT_POINTER(ptr, NULL) (old rcu_assign_pointer() macro was testing the NULL value and could omit the smp_wmb(), but this had to be removed because of compiler warnings) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/netprio_cgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 72ad0bc6841..3a9fd4826b7 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -285,7 +285,7 @@ static int netprio_device_event(struct notifier_block *unused,
break;
case NETDEV_UNREGISTER:
old = rtnl_dereference(dev->priomap);
- rcu_assign_pointer(dev->priomap, NULL);
+ RCU_INIT_POINTER(dev->priomap, NULL);
if (old)
kfree_rcu(old, rcu);
break;
@@ -332,7 +332,7 @@ static void __exit exit_cgroup_netprio(void)
rtnl_lock();
for_each_netdev(&init_net, dev) {
old = rtnl_dereference(dev->priomap);
- rcu_assign_pointer(dev->priomap, NULL);
+ RCU_INIT_POINTER(dev->priomap, NULL);
if (old)
kfree_rcu(old, rcu);
}