arm64: configs: add some devfreq gov for rk3399 linux
[firefly-linux-kernel-4.4.55.git] / net / batman-adv / network-coding.c
index f5276be2c77c8736ff73e98792312b5e453646e1..d0956f726547ae6c4c1a5d0b5f4d6bff8442c2be 100644 (file)
@@ -203,28 +203,25 @@ void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
 }
 
 /**
- * batadv_nc_node_free_rcu - rcu callback to free an nc node and remove
- *  its refcount on the orig_node
- * @rcu: rcu pointer of the nc node
+ * batadv_nc_node_release - release nc_node from lists and queue for free after
+ *  rcu grace period
+ * @nc_node: the nc node to free
  */
-static void batadv_nc_node_free_rcu(struct rcu_head *rcu)
+static void batadv_nc_node_release(struct batadv_nc_node *nc_node)
 {
-       struct batadv_nc_node *nc_node;
-
-       nc_node = container_of(rcu, struct batadv_nc_node, rcu);
        batadv_orig_node_free_ref(nc_node->orig_node);
-       kfree(nc_node);
+       kfree_rcu(nc_node, rcu);
 }
 
 /**
- * batadv_nc_node_free_ref - decrements the nc node refcounter and possibly
- * frees it
+ * batadv_nc_node_free_ref - decrement the nc node refcounter and possibly
+ *  release it
  * @nc_node: the nc node to free
  */
 static void batadv_nc_node_free_ref(struct batadv_nc_node *nc_node)
 {
        if (atomic_dec_and_test(&nc_node->refcount))
-               call_rcu(&nc_node->rcu, batadv_nc_node_free_rcu);
+               batadv_nc_node_release(nc_node);
 }
 
 /**