Skip to content

Commit c84f91e

Browse files
committed
virtio_config: fix up warnings on parisc
Apparently, on parisc le16_to_cpu returns an int. virtio_cread_le is very strict about type sizes so it causes a warning. Fix it up by casting to the correct type. Reported-by: kernel test robot <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1a86b37 commit c84f91e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

include/linux/virtio_config.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
357357
*/
358358
#define virtio_le_to_cpu(x) \
359359
_Generic((x), \
360-
__u8: (x), \
361-
__le16: le16_to_cpu(x), \
362-
__le32: le32_to_cpu(x), \
363-
__le64: le64_to_cpu(x) \
360+
__u8: (u8)(x), \
361+
__le16: (u16)le16_to_cpu(x), \
362+
__le32: (u32)le32_to_cpu(x), \
363+
__le64: (u64)le64_to_cpu(x) \
364364
)
365365

366366
#define virtio_cpu_to_le(x, m) \
@@ -400,7 +400,6 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
400400
*(ptr) = virtio_le_to_cpu(virtio_cread_v); \
401401
} while(0)
402402

403-
/* Config space accessors. */
404403
#define virtio_cwrite_le(vdev, structname, member, ptr) \
405404
do { \
406405
typeof(((structname*)0)->member) virtio_cwrite_v = \

0 commit comments

Comments
 (0)