aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/virtio_ring.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2019-10-03 23:29:24 +0300
committerDavid S. Miller <davem@davemloft.net>2019-10-04 14:25:17 -0700
commitd6547f2a2cfc8b145b59291d3e4b072891f34882 (patch)
treee6ba98654575733f5f25616e79b587931520e99c /include/uapi/linux/virtio_ring.h
parentMerge branch 'net-phy-broadcom-RGMII-delays-fixes' (diff)
downloadlinux-dev-d6547f2a2cfc8b145b59291d3e4b072891f34882.tar.xz
linux-dev-d6547f2a2cfc8b145b59291d3e4b072891f34882.zip
net, uapi: fix -Wpointer-arith warnings
Add casts to fix these warnings: ./usr/include/linux/netfilter_arp/arp_tables.h:200:19: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] ./usr/include/linux/netfilter_bridge/ebtables.h:197:19: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] ./usr/include/linux/netfilter_ipv4/ip_tables.h:223:19: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] ./usr/include/linux/netfilter_ipv6/ip6_tables.h:263:19: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] ./usr/include/linux/tipc_config.h:310:28: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] ./usr/include/linux/tipc_config.h:410:24: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] ./usr/include/linux/virtio_ring.h:170:16: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] Those are theoretical probably but kernel doesn't control compiler flags in userspace. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--include/uapi/linux/virtio_ring.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h
index 4c4e24c291a5..559f42e73315 100644
--- a/include/uapi/linux/virtio_ring.h
+++ b/include/uapi/linux/virtio_ring.h
@@ -169,7 +169,7 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
{
vr->num = num;
vr->desc = p;
- vr->avail = p + num*sizeof(struct vring_desc);
+ vr->avail = (struct vring_avail *)((char *)p + num * sizeof(struct vring_desc));
vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio16)
+ align-1) & ~(align - 1));
}