Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio_pci_modern: fix complaint by sparse

drivers/virtio/virtio_pci_modern.c:66:40: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:66:40: expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:66:40: got restricted __le32 [noderef] [usertype] <asn:2>*lo
drivers/virtio/virtio_pci_modern.c:67:33: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:67:33: expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:67:33: got restricted __le32 [noderef] [usertype] <asn:2>*hi
drivers/virtio/virtio_pci_modern.c:150:32: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:150:32: expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:150:32: got restricted __le32 [noderef] <asn:2>*<noident>
drivers/virtio/virtio_pci_modern.c:151:39: warning: incorrect type in argument 1 (different base types)
drivers/virtio/virtio_pci_modern.c:151:39: expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:151:39: got restricted __le32 [noderef] <asn:2>*<noident>
drivers/virtio/virtio_pci_modern.c:152:32: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:152:32: expected unsigned int [noderef] [usertype] <asn:2>*addr

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Gonglei and committed by
Michael S. Tsirkin
61bd405f a57cb1c1

+4 -4
+4 -4
drivers/virtio/virtio_pci_modern.c
··· 33 33 { 34 34 return ioread8(addr); 35 35 } 36 - static inline u16 vp_ioread16 (u16 __iomem *addr) 36 + static inline u16 vp_ioread16 (__le16 __iomem *addr) 37 37 { 38 38 return ioread16(addr); 39 39 } 40 40 41 - static inline u32 vp_ioread32(u32 __iomem *addr) 41 + static inline u32 vp_ioread32(__le32 __iomem *addr) 42 42 { 43 43 return ioread32(addr); 44 44 } ··· 48 48 iowrite8(value, addr); 49 49 } 50 50 51 - static inline void vp_iowrite16(u16 value, u16 __iomem *addr) 51 + static inline void vp_iowrite16(u16 value, __le16 __iomem *addr) 52 52 { 53 53 iowrite16(value, addr); 54 54 } 55 55 56 - static inline void vp_iowrite32(u32 value, u32 __iomem *addr) 56 + static inline void vp_iowrite32(u32 value, __le32 __iomem *addr) 57 57 { 58 58 iowrite32(value, addr); 59 59 }