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

[NET]: Annotate __skb_checksum_complete() and friends.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Al Viro and committed by
David S. Miller
b51655b9 b1550f22

+22 -22
+3 -3
include/linux/netfilter.h
··· 290 290 291 291 struct nf_afinfo { 292 292 unsigned short family; 293 - unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, 293 + __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, 294 294 unsigned int dataoff, u_int8_t protocol); 295 295 void (*saveroute)(const struct sk_buff *skb, 296 296 struct nf_info *info); ··· 305 305 return rcu_dereference(nf_afinfo[family]); 306 306 } 307 307 308 - static inline unsigned int 308 + static inline __sum16 309 309 nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, 310 310 u_int8_t protocol, unsigned short family) 311 311 { 312 312 struct nf_afinfo *afinfo; 313 - unsigned int csum = 0; 313 + __sum16 csum = 0; 314 314 315 315 rcu_read_lock(); 316 316 afinfo = nf_get_afinfo(family);
+1 -1
include/linux/netfilter_ipv4.h
··· 79 79 #ifdef __KERNEL__ 80 80 extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); 81 81 extern int ip_xfrm_me_harder(struct sk_buff **pskb); 82 - extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 82 + extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 83 83 unsigned int dataoff, u_int8_t protocol); 84 84 #endif /*__KERNEL__*/ 85 85
+1 -1
include/linux/netfilter_ipv6.h
··· 74 74 75 75 #ifdef CONFIG_NETFILTER 76 76 extern int ip6_route_me_harder(struct sk_buff *skb); 77 - extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 77 + extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 78 78 unsigned int dataoff, u_int8_t protocol); 79 79 80 80 extern int ipv6_netfilter_init(void);
+1 -1
include/linux/skbuff.h
··· 1398 1398 1399 1399 extern void __net_timestamp(struct sk_buff *skb); 1400 1400 1401 - extern unsigned int __skb_checksum_complete(struct sk_buff *skb); 1401 + extern __sum16 __skb_checksum_complete(struct sk_buff *skb); 1402 1402 1403 1403 /** 1404 1404 * skb_checksum_complete - Calculate checksum of an entire packet
+1 -1
include/net/tcp.h
··· 814 814 return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); 815 815 } 816 816 817 - static inline int __tcp_checksum_complete(struct sk_buff *skb) 817 + static inline __sum16 __tcp_checksum_complete(struct sk_buff *skb) 818 818 { 819 819 return __skb_checksum_complete(skb); 820 820 }
+4 -4
include/net/udp.h
··· 69 69 /* 70 70 * Generic checksumming routines for UDP(-Lite) v4 and v6 71 71 */ 72 - static inline u16 __udp_lib_checksum_complete(struct sk_buff *skb) 72 + static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb) 73 73 { 74 74 if (! UDP_SKB_CB(skb)->partial_cov) 75 75 return __skb_checksum_complete(skb); 76 - return csum_fold(skb_checksum(skb, 0, UDP_SKB_CB(skb)->cscov, 77 - skb->csum)); 76 + return csum_fold(skb_checksum(skb, 0, UDP_SKB_CB(skb)->cscov, 77 + skb->csum)); 78 78 } 79 79 80 - static __inline__ int udp_lib_checksum_complete(struct sk_buff *skb) 80 + static inline __sum16 udp_lib_checksum_complete(struct sk_buff *skb) 81 81 { 82 82 return skb->ip_summed != CHECKSUM_UNNECESSARY && 83 83 __udp_lib_checksum_complete(skb);
+1 -1
net/core/datagram.c
··· 411 411 return -EFAULT; 412 412 } 413 413 414 - unsigned int __skb_checksum_complete(struct sk_buff *skb) 414 + __sum16 __skb_checksum_complete(struct sk_buff *skb) 415 415 { 416 416 __sum16 sum; 417 417
+2 -2
net/core/netpoll.c
··· 77 77 } 78 78 } 79 79 80 - static int checksum_udp(struct sk_buff *skb, struct udphdr *uh, 81 - unsigned short ulen, __be32 saddr, __be32 daddr) 80 + static __sum16 checksum_udp(struct sk_buff *skb, struct udphdr *uh, 81 + unsigned short ulen, __be32 saddr, __be32 daddr) 82 82 { 83 83 __wsum psum; 84 84
+2 -2
net/ipv4/netfilter.c
··· 162 162 return 0; 163 163 } 164 164 165 - unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 165 + __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 166 166 unsigned int dataoff, u_int8_t protocol) 167 167 { 168 168 struct iphdr *iph = skb->nh.iph; 169 - unsigned int csum = 0; 169 + __sum16 csum = 0; 170 170 171 171 switch (skb->ip_summed) { 172 172 case CHECKSUM_COMPLETE:
+2 -2
net/ipv4/tcp_input.c
··· 3790 3790 return err; 3791 3791 } 3792 3792 3793 - static int __tcp_checksum_complete_user(struct sock *sk, struct sk_buff *skb) 3793 + static __sum16 __tcp_checksum_complete_user(struct sock *sk, struct sk_buff *skb) 3794 3794 { 3795 - int result; 3795 + __sum16 result; 3796 3796 3797 3797 if (sock_owned_by_user(sk)) { 3798 3798 local_bh_enable();
+1 -1
net/ipv4/tcp_ipv4.c
··· 1544 1544 return sk; 1545 1545 } 1546 1546 1547 - static int tcp_v4_checksum_init(struct sk_buff *skb) 1547 + static __sum16 tcp_v4_checksum_init(struct sk_buff *skb) 1548 1548 { 1549 1549 if (skb->ip_summed == CHECKSUM_COMPLETE) { 1550 1550 if (!tcp_v4_check(skb->h.th, skb->len, skb->nh.iph->saddr,
+2 -2
net/ipv6/netfilter.c
··· 80 80 return 0; 81 81 } 82 82 83 - unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 83 + __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 84 84 unsigned int dataoff, u_int8_t protocol) 85 85 { 86 86 struct ipv6hdr *ip6h = skb->nh.ipv6h; 87 - unsigned int csum = 0; 87 + __sum16 csum = 0; 88 88 89 89 switch (skb->ip_summed) { 90 90 case CHECKSUM_COMPLETE:
+1 -1
net/ipv6/tcp_ipv6.c
··· 1527 1527 return NULL; 1528 1528 } 1529 1529 1530 - static int tcp_v6_checksum_init(struct sk_buff *skb) 1530 + static __sum16 tcp_v6_checksum_init(struct sk_buff *skb) 1531 1531 { 1532 1532 if (skb->ip_summed == CHECKSUM_COMPLETE) { 1533 1533 if (!tcp_v6_check(skb->h.th,skb->len,&skb->nh.ipv6h->saddr,