Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3f9f417 authored by Andrea Parri's avatar Andrea Parri Committed by David S. Miller
Browse files

ptr_ring: Remove now-redundant smp_read_barrier_depends()



Because READ_ONCE() now implies smp_read_barrier_depends(), the
smp_read_barrier_depends() in __ptr_ring_consume() is redundant;
this commit removes it and updates the comments.

Signed-off-by: default avatarAndrea Parri <parri.andrea@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: <linux-kernel@vger.kernel.org>
Cc: <netdev@vger.kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ec010e7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -296,13 +296,14 @@ static inline void *__ptr_ring_consume(struct ptr_ring *r)
{
	void *ptr;

	/* The READ_ONCE in __ptr_ring_peek guarantees that anyone
	 * accessing data through the pointer is up to date. Pairs
	 * with smp_wmb in __ptr_ring_produce.
	 */
	ptr = __ptr_ring_peek(r);
	if (ptr)
		__ptr_ring_discard_one(r);

	/* Make sure anyone accessing data through the pointer is up to date. */
	/* Pairs with smp_wmb in __ptr_ring_produce. */
	smp_read_barrier_depends();
	return ptr;
}