summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-14 21:24:49 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:23:27 -0800
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 f558c61aecc..e5a05a046fe 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -413,9 +413,9 @@ fault:
unsigned int __skb_checksum_complete(struct sk_buff *skb)
{
- unsigned int sum;
+ __sum16 sum;
- sum = (u16)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
+ sum = csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
if (likely(!sum)) {
if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
netdev_rx_csum_fault(skb->dev);
@@ -441,7 +441,7 @@ EXPORT_SYMBOL(__skb_checksum_complete);
int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
int hlen, struct iovec *iov)
{
- unsigned int csum;
+ __wsum csum;
int chunk = skb->len - hlen;
/* Skip filled elements.
@@ -460,7 +460,7 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
if (skb_copy_and_csum_datagram(skb, hlen, iov->iov_base,
chunk, &csum))
goto fault;
- if ((unsigned short)csum_fold(csum))
+ if (csum_fold(csum))
goto csum_error;
if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
netdev_rx_csum_fault(skb->dev);
diff --git a/net/core/dev.c b/net/core/dev.c
index a7be106d0fd..1a36b17f4b5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1169,7 +1169,7 @@ EXPORT_SYMBOL(netif_device_attach);
*/
int skb_checksum_help(struct sk_buff *skb)
{
- unsigned int csum;
+ __wsum csum;
int ret = 0, offset = skb->h.raw - skb->data;
if (skb->ip_summed == CHECKSUM_COMPLETE)
@@ -1193,7 +1193,7 @@ int skb_checksum_help(struct sk_buff *skb)
BUG_ON(offset <= 0);
BUG_ON(skb->csum + 2 > offset);
- *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum);
+ *(__sum16*)(skb->h.raw + skb->csum) = csum_fold(csum);
out_set_summed:
skb->ip_summed = CHECKSUM_NONE;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 523141ee920..edd3246873e 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,
psum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
if (skb->ip_summed == CHECKSUM_COMPLETE &&
- !(u16)csum_fold(csum_add(psum, skb->csum)))
+ !csum_fold(csum_add(psum, skb->csum)))
return 0;
skb->csum = psum;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b3dea1ef953..dfa02cc8d68 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,
void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
{
- unsigned int csum;
+ __wsum csum;
long csstart;
if (skb->ip_summed == CHECKSUM_PARTIAL)
@@ -1416,7 +1416,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
if (skb->ip_summed == CHECKSUM_PARTIAL) {
long csstuff = csstart + skb->csum;
- *((unsigned short *)(to + csstuff)) = csum_fold(csum);
+ *((__sum16 *)(to + csstuff)) = csum_fold(csum);
}
}