diff mbox series

[v2] Docs/RCU: Correct sample code of qatomic_rcu_set

Message ID 20210106071710.15836-1-zhukeqian1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2] Docs/RCU: Correct sample code of qatomic_rcu_set | expand

Commit Message

zhukeqian Jan. 6, 2021, 7:17 a.m. UTC
Correct sample code to avoid confusing readers.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Cc: qemu-trivial@nongnu.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---

v2:
 - Add Cc and R-b.

---
 docs/devel/rcu.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Hajnoczi Jan. 6, 2021, 5:02 p.m. UTC | #1
On Wed, Jan 06, 2021 at 03:17:10PM +0800, Keqian Zhu wrote:
> Correct sample code to avoid confusing readers.
> 
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
> Cc: qemu-trivial@nongnu.org
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Reviewed-by: Peter Xu <peterx@redhat.com>
> ---
> 
> v2:
>  - Add Cc and R-b.
> 
> ---
>  docs/devel/rcu.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Paolo Bonzini Jan. 7, 2021, 6:14 p.m. UTC | #2
On 06/01/21 08:17, Keqian Zhu wrote:
> Correct sample code to avoid confusing readers.
> 
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
> Cc: qemu-trivial@nongnu.org
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Reviewed-by: Peter Xu <peterx@redhat.com>
> ---
> 
> v2:
>   - Add Cc and R-b.
> 
> ---
>   docs/devel/rcu.txt | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/devel/rcu.txt b/docs/devel/rcu.txt
> index cdf002edd8..2e6cc607a1 100644
> --- a/docs/devel/rcu.txt
> +++ b/docs/devel/rcu.txt
> @@ -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.  */
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/docs/devel/rcu.txt b/docs/devel/rcu.txt
index cdf002edd8..2e6cc607a1 100644
--- a/docs/devel/rcu.txt
+++ b/docs/devel/rcu.txt
@@ -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.  */