Files
kernel/include/linux
Paul E. McKenney b9964ce745 rcu: Create an unrcu_pointer() to remove __rcu from a pointer
The xchg() and cmpxchg() functions are sometimes used to carry out RCU
updates.  Unfortunately, this can result in sparse warnings for both
the old-value and new-value arguments, as well as for the return value.
The arguments can be dealt with using RCU_INITIALIZER():

        old_p = xchg(&p, RCU_INITIALIZER(new_p));

But a sparse warning still remains due to assigning the __rcu pointer
returned from xchg to the (most likely) non-__rcu pointer old_p.

This commit therefore provides an unrcu_pointer() macro that strips
the __rcu.  This macro can be used as follows:

        old_p = unrcu_pointer(xchg(&p, RCU_INITIALIZER(new_p)));

Reported-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210624160609.292325-2-toke@redhat.com
2021-06-24 19:41:14 +02:00
..
2021-06-03 14:04:18 -07:00
2021-05-18 17:24:52 +01:00
2021-05-06 19:24:11 -07:00
2021-04-14 16:30:30 +03:00
2021-05-08 21:49:48 -06:00
2021-05-24 21:13:05 -07:00
2021-05-19 00:33:40 +02:00
2021-06-15 18:01:06 +02:00
2021-04-08 16:04:20 -07:00
2021-05-24 12:45:26 -04:00
2021-05-24 12:45:26 -04:00
2021-04-08 16:04:20 -07:00
2021-04-08 16:04:20 -07:00
2021-05-06 19:24:11 -07:00
2021-04-19 13:13:26 -04:00
2021-04-12 15:04:23 +02:00
2021-05-07 00:26:34 -07:00
2021-04-08 16:04:20 -07:00
2021-04-30 11:20:40 -07:00
2021-04-05 22:39:38 -04:00
2021-06-07 14:11:47 -07:00
2021-06-07 14:11:47 -07:00
2021-04-08 16:04:20 -07:00
2021-06-03 13:10:17 -07:00
2021-04-06 08:34:39 +02:00
2021-04-21 10:24:41 -05:00
2021-06-12 13:08:57 -07:00
2021-06-07 14:11:47 -07:00
2021-05-06 19:24:11 -07:00
2021-04-15 10:32:17 +02:00
2021-03-30 17:06:49 -07:00
2021-04-26 22:55:12 +01:00
2021-04-09 16:00:00 +02:00
2021-05-07 00:26:35 -07:00
2021-06-12 13:16:45 -07:00
2021-03-30 13:42:33 -04:00