diff options
author | Mark Rutland <mark.rutland@arm.com> | 2016-11-24 05:25:13 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-12-15 17:13:36 -0500 |
commit | 9d1b972f8a25bba01ecfc1d90d7a2fbf1923d052 (patch) | |
tree | 1bd77f81a5fa856be74926ef14ebc2b29598c758 /drivers/vhost/vringh.c | |
parent | 5da889c795b1fbefc9d8f058b54717ab8ab17891 (diff) |
vringh: kill off ACCESS_ONCE()
Despite living under drivers/ vringh.c is also used as part of the userspace
virtio tools. Before we can kill off the ACCESS_ONCE()definition in the tools,
we must convert vringh.c to use {READ,WRITE}_ONCE().
This patch does so, along with the required include of <linux/compiler.h> for
the relevant definitions. The userspace tools provide their own definitions in
their own <linux/compiler.h>.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vhost/vringh.c')
-rw-r--r-- | drivers/vhost/vringh.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 3bb02c60a2f5..bb8971f2a634 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Since these may be in userspace, we use (inline) accessors. | 4 | * Since these may be in userspace, we use (inline) accessors. |
5 | */ | 5 | */ |
6 | #include <linux/compiler.h> | ||
6 | #include <linux/module.h> | 7 | #include <linux/module.h> |
7 | #include <linux/vringh.h> | 8 | #include <linux/vringh.h> |
8 | #include <linux/virtio_ring.h> | 9 | #include <linux/virtio_ring.h> |
@@ -820,13 +821,13 @@ EXPORT_SYMBOL(vringh_need_notify_user); | |||
820 | static inline int getu16_kern(const struct vringh *vrh, | 821 | static inline int getu16_kern(const struct vringh *vrh, |
821 | u16 *val, const __virtio16 *p) | 822 | u16 *val, const __virtio16 *p) |
822 | { | 823 | { |
823 | *val = vringh16_to_cpu(vrh, ACCESS_ONCE(*p)); | 824 | *val = vringh16_to_cpu(vrh, READ_ONCE(*p)); |
824 | return 0; | 825 | return 0; |
825 | } | 826 | } |
826 | 827 | ||
827 | static inline int putu16_kern(const struct vringh *vrh, __virtio16 *p, u16 val) | 828 | static inline int putu16_kern(const struct vringh *vrh, __virtio16 *p, u16 val) |
828 | { | 829 | { |
829 | ACCESS_ONCE(*p) = cpu_to_vringh16(vrh, val); | 830 | WRITE_ONCE(*p, cpu_to_vringh16(vrh, val)); |
830 | return 0; | 831 | return 0; |
831 | } | 832 | } |
832 | 833 | ||