Skip to content

Commit 3a5db0b

Browse files
committed
drivers/vhost: Remove now-redundant read_barrier_depends()
Because READ_ONCE() now implies read_barrier_depends(), the read_barrier_depends() in next_desc() is now redundant. This commit therefore removes it and the related comments. Signed-off-by: Paul E. McKenney <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Jason Wang <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]>
1 parent 91db259 commit 3a5db0b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/vhost/vhost.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,12 +1877,7 @@ static unsigned next_desc(struct vhost_virtqueue *vq, struct vring_desc *desc)
18771877
return -1U;
18781878

18791879
/* Check they're not leading us off end of descriptors. */
1880-
next = vhost16_to_cpu(vq, desc->next);
1881-
/* Make sure compiler knows to grab that: we don't want it changing! */
1882-
/* We will use the result as an index in an array, so most
1883-
* architectures only need a compiler barrier here. */
1884-
read_barrier_depends();
1885-
1880+
next = vhost16_to_cpu(vq, READ_ONCE(desc->next));
18861881
return next;
18871882
}
18881883

0 commit comments

Comments
 (0)