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>
This commit is contained in:

committed by
David S. Miller

parent
de417d137d
commit
d6547f2a2c
@@ -309,7 +309,7 @@ static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
|
||||
tlv_ptr->tlv_len = htons(tlv_len);
|
||||
if (len && data) {
|
||||
memcpy(TLV_DATA(tlv_ptr), data, len);
|
||||
memset(TLV_DATA(tlv_ptr) + len, 0, TLV_SPACE(len) - tlv_len);
|
||||
memset((char *)TLV_DATA(tlv_ptr) + len, 0, TLV_SPACE(len) - tlv_len);
|
||||
}
|
||||
return TLV_SPACE(len);
|
||||
}
|
||||
@@ -409,7 +409,7 @@ static inline int TCM_SET(void *msg, __u16 cmd, __u16 flags,
|
||||
tcm_hdr->tcm_flags = htons(flags);
|
||||
if (data_len && data) {
|
||||
memcpy(TCM_DATA(msg), data, data_len);
|
||||
memset(TCM_DATA(msg) + data_len, 0, TCM_SPACE(data_len) - msg_len);
|
||||
memset((char *)TCM_DATA(msg) + data_len, 0, TCM_SPACE(data_len) - msg_len);
|
||||
}
|
||||
return TCM_SPACE(data_len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user