summaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_config.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2020-07-10 07:55:52 -0400
committerMichael S. Tsirkin <mst@redhat.com>2020-08-05 11:08:40 -0400
commit4a04cfb0eb5e00432f9ff978f2b81bd1736e85db (patch)
tree9345fcb006252fec0d25a4d784a0a24260e332c5 /include/linux/virtio_config.h
parent965b5350514b597dc6347b733127e180844aeb43 (diff)
downloadlinux-stable-4a04cfb0eb5e00432f9ff978f2b81bd1736e85db.tar.gz
linux-stable-4a04cfb0eb5e00432f9ff978f2b81bd1736e85db.tar.bz2
linux-stable-4a04cfb0eb5e00432f9ff978f2b81bd1736e85db.zip
virtio_config: disallow native type fields
Transitional devices should all use __virtioXX types (and __leXX for fields not present in 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.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 64da491936f7..c68f58f3bf34 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -319,9 +319,8 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
__virtio_pick_type(x, __u8, __u8, \
__virtio_pick_endian(x, __virtio16, __virtio32, __virtio64, \
__virtio_pick_endian(x, __le16, __le32, __le64, \
- __virtio_pick_endian(x, __u16, __u32, __u64, \
- /* No other type allowed */ \
- (void)0)))))
+ /* No other type allowed */ \
+ (void)0))))
#endif