Skip to content

Commit 83eb9db

Browse files
committed
virtio_config: drop LE option from config space
All drivers now use virtio_cread/write_le for LE config space fields. Drop LE option from virtio_cread/write, only leaving the option to access transitional fields. Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent d83c67c commit 83eb9db

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

include/linux/virtio_config.h

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -293,39 +293,15 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
293293
__u8: (x), \
294294
__virtio16: virtio16_to_cpu((vdev), (x)), \
295295
__virtio32: virtio32_to_cpu((vdev), (x)), \
296-
__virtio64: virtio64_to_cpu((vdev), (x)), \
297-
/*
298-
* Why define a default? checker can distinguish between
299-
* e.g. __u16, __le16 and __virtio16, but GCC can't so
300-
* attempts to define variants for both look like a duplicate
301-
* variant to it.
302-
*/ \
303-
default: _Generic((x), \
304-
__u8: (x), \
305-
__le16: virtio16_to_cpu((vdev), (__force __virtio16)(x)), \
306-
__le32: virtio32_to_cpu((vdev), (__force __virtio32)(x)), \
307-
__le64: virtio64_to_cpu((vdev), (__force __virtio64)(x)) \
308-
) \
296+
__virtio64: virtio64_to_cpu((vdev), (x)) \
309297
)
310298

311299
#define cpu_to_virtio(vdev, x, m) \
312300
_Generic((m), \
313301
__u8: (x), \
314302
__virtio16: cpu_to_virtio16((vdev), (x)), \
315303
__virtio32: cpu_to_virtio32((vdev), (x)), \
316-
__virtio64: cpu_to_virtio64((vdev), (x)), \
317-
/*
318-
* Why define a default? checker can distinguish between
319-
* e.g. __u16, __le16 and __virtio16, but GCC can't so
320-
* attempts to define variants for both look like a duplicate
321-
* variant to it.
322-
*/ \
323-
default: _Generic((m), \
324-
__u8: (x), \
325-
__le16: (__force __le16)cpu_to_virtio16((vdev), (x)), \
326-
__le32: (__force __le32)cpu_to_virtio32((vdev), (x)), \
327-
__le64: (__force __le64)cpu_to_virtio64((vdev), (x)) \
328-
) \
304+
__virtio64: cpu_to_virtio64((vdev), (x)) \
329305
)
330306

331307
#define __virtio_native_type(structname, member) \

0 commit comments

Comments
 (0)