Skip to contentSkip to conversation

Docs/RCU: Correct sample code of qatomic_rcu_set

PATCH Superseded Keqian Zhu 3 participants 3 messages Dec 21, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Keqian Zhu

author
#0 lore raw

PATCH 1/1 Docs/RCU: Correct sample code of qatomic_rcu_set

Correct sample code to avoid confusing readers.

---
 docs/devel/rcu.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/devel/rcu.txt +1 -1
index cdf002edd8..2e6cc607a1 100644
@@ -392,7 +392,7 @@ Instead, we store the size of the array with the array itself:
 
             /* Removal phase.  */
             old_array = global_array;
-            qatomic_rcu_set(&new_array->data, new_array);
+            qatomic_rcu_set(&global_array, new_array);
             synchronize_rcu();
 
             /* Reclamation phase.  */
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Keqian Zhu

Correct sample code to avoid confusing readers.

---
  docs/devel/rcu.txt | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
docs/devel/rcu.txt +0 -0
index cdf002edd8..2e6cc607a1 100644

docs/devel/rcu.txt Instead, we store the size of the array with the array itself: · line 398

Quoted 8 lines
docs/devel/rcu.txt +1 -1
@@ -392,7 +392,7 @@ Instead, we store the size of the array with the array itself:
 
              /* Removal phase.  */
              old_array = global_array;
-            qatomic_rcu_set(&new_array->data, new_array);
+            qatomic_rcu_set(&global_array, new_array);
              synchronize_rcu();
 
              /* Reclamation phase.  */