Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

SeongJae Park and committed by
Paul E. McKenney
674dd365 3f831e38

+2 -2
+2 -2
Documentation/RCU/rculist_nulls.rst
··· 56 56 struct hlist_node *node, *next; 57 57 for (pos = rcu_dereference((head)->first); 58 58 pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && 59 - ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); 59 + ({ obj = hlist_entry(pos, typeof(*obj), member); 1; }); 60 60 pos = rcu_dereference(next)) 61 61 if (obj->key == key) 62 62 return obj; ··· 68 68 struct hlist_node *node; 69 69 for (pos = rcu_dereference((head)->first); 70 70 pos && ({ prefetch(pos->next); 1; }) && 71 - ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); 71 + ({ obj = hlist_entry(pos, typeof(*obj), member); 1; }); 72 72 pos = rcu_dereference(pos->next)) 73 73 if (obj->key == key) 74 74 return obj;