summaryrefslogtreecommitdiff
path: root/include/linux/virtio_config.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2020-07-10 14:55:52 +0300
committerMichael S. Tsirkin <mst@redhat.com>2020-08-05 18:08:41 +0300
commit14191c15ab9d87e60d2ebbfbf6df83d546152af1 (patch)
treeae675e4e2c6c4a5cd7caaed061ed858f81b0310e /include/linux/virtio_config.h
parenta5b90f2db8e0ef6504695cbd36a65fd8296338ee (diff)
downloadlinux-14191c15ab9d87e60d2ebbfbf6df83d546152af1.tar.xz
virtio_config: disallow native type fields (again)
_Generic version allowed __uXX types but that is no longer necessary: Transitional devices should all use __virtioXX types (and __leXX for fields not present in the legacy devices). Modern ones should use __leXX. _uXX type would be a bug. Let's prevent that. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux/virtio_config.h')
-rw-r--r--include/linux/virtio_config.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 7fa000f02721..441fd6dd42ab 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -304,13 +304,7 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
__u8: (x), \
__le16: virtio16_to_cpu((vdev), (__force __virtio16)(x)), \
__le32: virtio32_to_cpu((vdev), (__force __virtio32)(x)), \
- __le64: virtio64_to_cpu((vdev), (__force __virtio64)(x)), \
- default: _Generic((x), \
- __u8: (x), \
- __u16: virtio16_to_cpu((vdev), (__force __virtio16)(x)), \
- __u32: virtio32_to_cpu((vdev), (__force __virtio32)(x)), \
- __u64: virtio64_to_cpu((vdev), (__force __virtio64)(x)) \
- ) \
+ __le64: virtio64_to_cpu((vdev), (__force __virtio64)(x)) \
) \
)
@@ -330,13 +324,7 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
__u8: (x), \
__le16: (__force __le16)cpu_to_virtio16((vdev), (x)), \
__le32: (__force __le32)cpu_to_virtio32((vdev), (x)), \
- __le64: (__force __le64)cpu_to_virtio64((vdev), (x)), \
- default: _Generic((m), \
- __u8: (x), \
- __u16: (__force __u16)cpu_to_virtio16((vdev), (x)), \
- __u32: (__force __u32)cpu_to_virtio32((vdev), (x)), \
- __u64: (__force __u64)cpu_to_virtio64((vdev), (x)) \
- ) \
+ __le64: (__force __le64)cpu_to_virtio64((vdev), (x)) \
) \
)