aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-15 00:24:49 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:23:27 -0500
commitd3bc23e7ee9db8023dff5a86bb3b0069ed018789 (patch)
treef281b190a20084386666e0f3bb957df427b93ca7 /net/core
parent9981a0e36a572e9fcf84bfab915fdc93bed0e3c9 (diff)
[NET]: Annotate callers of csum_fold() in net/*
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/datagram.c8
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/netpoll.c2
-rw-r--r--net/core/skbuff.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c
index f558c61aecc7..e5a05a046fef 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -413,9 +413,9 @@ fault:
413 413
414unsigned int __skb_checksum_complete(struct sk_buff *skb) 414unsigned int __skb_checksum_complete(struct sk_buff *skb)
415{ 415{
416 unsigned int sum; 416 __sum16 sum;
417 417
418 sum = (u16)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)); 418 sum = csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
419 if (likely(!sum)) { 419 if (likely(!sum)) {
420 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE)) 420 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
421 netdev_rx_csum_fault(skb->dev); 421 netdev_rx_csum_fault(skb->dev);
@@ -441,7 +441,7 @@ EXPORT_SYMBOL(__skb_checksum_complete);
441int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, 441int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
442 int hlen, struct iovec *iov) 442 int hlen, struct iovec *iov)
443{ 443{
444 unsigned int csum; 444 __wsum csum;
445 int chunk = skb->len - hlen; 445 int chunk = skb->len - hlen;
446 446
447 /* Skip filled elements. 447 /* Skip filled elements.
@@ -460,7 +460,7 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
460 if (skb_copy_and_csum_datagram(skb, hlen, iov->iov_base, 460 if (skb_copy_and_csum_datagram(skb, hlen, iov->iov_base,
461 chunk, &csum)) 461 chunk, &csum))
462 goto fault; 462 goto fault;
463 if ((unsigned short)csum_fold(csum)) 463 if (csum_fold(csum))
464 goto csum_error; 464 goto csum_error;
465 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE)) 465 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
466 netdev_rx_csum_fault(skb->dev); 466 netdev_rx_csum_fault(skb->dev);
diff --git a/net/core/dev.c b/net/core/dev.c
index a7be106d0fdb..1a36b17f4b51 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1169,7 +1169,7 @@ EXPORT_SYMBOL(netif_device_attach);
1169 */ 1169 */
1170int skb_checksum_help(struct sk_buff *skb) 1170int skb_checksum_help(struct sk_buff *skb)
1171{ 1171{
1172 unsigned int csum; 1172 __wsum csum;
1173 int ret = 0, offset = skb->h.raw - skb->data; 1173 int ret = 0, offset = skb->h.raw - skb->data;
1174 1174
1175 if (skb->ip_summed == CHECKSUM_COMPLETE) 1175 if (skb->ip_summed == CHECKSUM_COMPLETE)
@@ -1193,7 +1193,7 @@ int skb_checksum_help(struct sk_buff *skb)
1193 BUG_ON(offset <= 0); 1193 BUG_ON(offset <= 0);
1194 BUG_ON(skb->csum + 2 > offset); 1194 BUG_ON(skb->csum + 2 > offset);
1195 1195
1196 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); 1196 *(__sum16*)(skb->h.raw + skb->csum) = csum_fold(csum);
1197 1197
1198out_set_summed: 1198out_set_summed:
1199 skb->ip_summed = CHECKSUM_NONE; 1199 skb->ip_summed = CHECKSUM_NONE;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 523141ee920c..edd3246873e8 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -88,7 +88,7 @@ static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
88 psum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0); 88 psum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
89 89
90 if (skb->ip_summed == CHECKSUM_COMPLETE && 90 if (skb->ip_summed == CHECKSUM_COMPLETE &&
91 !(u16)csum_fold(csum_add(psum, skb->csum))) 91 !csum_fold(csum_add(psum, skb->csum)))
92 return 0; 92 return 0;
93 93
94 skb->csum = psum; 94 skb->csum = psum;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b3dea1ef9535..dfa02cc8d687 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1396,7 +1396,7 @@ unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
1396 1396
1397void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to) 1397void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
1398{ 1398{
1399 unsigned int csum; 1399 __wsum csum;
1400 long csstart; 1400 long csstart;
1401 1401
1402 if (skb->ip_summed == CHECKSUM_PARTIAL) 1402 if (skb->ip_summed == CHECKSUM_PARTIAL)
@@ -1416,7 +1416,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
1416 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1416 if (skb->ip_summed == CHECKSUM_PARTIAL) {
1417 long csstuff = csstart + skb->csum; 1417 long csstuff = csstart + skb->csum;
1418 1418
1419 *((unsigned short *)(to + csstuff)) = csum_fold(csum); 1419 *((__sum16 *)(to + csstuff)) = csum_fold(csum);
1420 } 1420 }
1421} 1421}
1422 1422