diff options
author | SeongJae Park <sj@kernel.org> | 2023-06-13 20:24:32 +0200 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2023-07-14 23:55:56 +0200 |
commit | 674dd365736125b56297aaea8845a90e5ea990b9 (patch) | |
tree | 76555757504a9ad24ba6076205d76e930a17aab9 /Documentation/RCU | |
parent | Docs/RCU/rculist_nulls: Fix trivial coding style (diff) | |
download | linux-674dd365736125b56297aaea8845a90e5ea990b9.tar.xz linux-674dd365736125b56297aaea8845a90e5ea990b9.zip |
Docs/RCU/rculist_nulls: Assign 'obj' before use from the examples
Lookup example code snippets in rculist_nulls.rst are using 'obj'
without assignment. Fix the code to assign it properly.
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'Documentation/RCU')
-rw-r--r-- | Documentation/RCU/rculist_nulls.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst index 25b739885cfa..4d6f077552ed 100644 --- a/Documentation/RCU/rculist_nulls.rst +++ b/Documentation/RCU/rculist_nulls.rst @@ -56,7 +56,7 @@ but a version with an additional memory barrier (smp_rmb()) struct hlist_node *node, *next; for (pos = rcu_dereference((head)->first); pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && - ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); + ({ obj = hlist_entry(pos, typeof(*obj), member); 1; }); pos = rcu_dereference(next)) if (obj->key == key) return obj; @@ -68,7 +68,7 @@ And note the traditional hlist_for_each_entry_rcu() misses this smp_rmb():: struct hlist_node *node; for (pos = rcu_dereference((head)->first); pos && ({ prefetch(pos->next); 1; }) && - ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); + ({ obj = hlist_entry(pos, typeof(*obj), member); 1; }); pos = rcu_dereference(pos->next)) if (obj->key == key) return obj; |