diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2020-08-05 19:55:50 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-08-05 19:56:03 -0400 |
commit | c84f91e2622235bb742f9f20b8675cf095157026 (patch) | |
tree | c24a2b1b9835986c54c81a3334112fa672b68454 /include/linux/virtio_config.h | |
parent | 1a86b377aa2147a7c866b03142e848c18e5f3cb8 (diff) | |
download | linux-c84f91e2622235bb742f9f20b8675cf095157026.tar.gz linux-c84f91e2622235bb742f9f20b8675cf095157026.tar.bz2 linux-c84f91e2622235bb742f9f20b8675cf095157026.zip |
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 <lkp@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20200805235550.1451637-1-mst@redhat.com
Diffstat (limited to 'include/linux/virtio_config.h')
-rw-r--r-- | include/linux/virtio_config.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index ecb166c824bb..8fe857e27ef3 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -357,10 +357,10 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) */ #define virtio_le_to_cpu(x) \ _Generic((x), \ - __u8: (x), \ - __le16: le16_to_cpu(x), \ - __le32: le32_to_cpu(x), \ - __le64: le64_to_cpu(x) \ + __u8: (u8)(x), \ + __le16: (u16)le16_to_cpu(x), \ + __le32: (u32)le32_to_cpu(x), \ + __le64: (u64)le64_to_cpu(x) \ ) #define virtio_cpu_to_le(x, m) \ @@ -400,7 +400,6 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) *(ptr) = virtio_le_to_cpu(virtio_cread_v); \ } while(0) -/* Config space accessors. */ #define virtio_cwrite_le(vdev, structname, member, ptr) \ do { \ typeof(((structname*)0)->member) virtio_cwrite_v = \ |