]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[NET]: Annotate csum_partial() callers in net/*
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 15 Nov 2006 05:36:14 +0000 (21:36 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:23:32 +0000 (21:23 -0800)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/socket.h
include/linux/sunrpc/xdr.h
net/core/iovec.c
net/core/skbuff.c
net/ipv4/ip_output.c
net/unix/af_unix.c

index 592b666798236a41401c0687b5c060d2e2e6bcce..92cd38efad7fbca2429bbcb9453634abc4684bdd 100644 (file)
@@ -293,7 +293,7 @@ extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov,
 extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 
                                          struct iovec *iov, 
                                          int offset, 
-                                         unsigned int len, int *csump);
+                                         unsigned int len, __wsum *csump);
 
 extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
 extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
index ac69e55116060be1d29fb783a812d861011ac548..9a527c3643948a266bdcc862c2537e5f277a2f56 100644 (file)
@@ -151,7 +151,7 @@ typedef struct {
        struct sk_buff  *skb;
        unsigned int    offset;
        size_t          count;
-       unsigned int    csum;
+       __wsum          csum;
 } skb_reader_t;
 
 typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
index 65e4b56fbc774cb7b605065f8cac65c7006dbbe4..04b249c40b5b24a12f0e24165621cc182b1ec1c4 100644 (file)
@@ -158,9 +158,9 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset,
  *     call to this function will be unaligned also.
  */
 int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
-                                int offset, unsigned int len, int *csump)
+                                int offset, unsigned int len, __wsum *csump)
 {
-       int csum = *csump;
+       __wsum csum = *csump;
        int partial_cnt = 0, err = 0;
 
        /* Skip over the finished iovecs */
index dfa02cc8d68725afdd40a291c8cde9f35f67a44d..c0e3427057fc52313461f66d0bd3872f1d5fa4ad 100644 (file)
@@ -1265,7 +1265,7 @@ unsigned int skb_checksum(const struct sk_buff *skb, int offset,
 
                end = start + skb_shinfo(skb)->frags[i].size;
                if ((copy = end - offset) > 0) {
-                       unsigned int csum2;
+                       __wsum csum2;
                        u8 *vaddr;
                        skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 
index 5f3e35c036379e9d71dc2bb324c171da2c2b41ea..f9194f7e39d375a5ca64b42f24c19dfe1973f9b7 100644 (file)
@@ -682,7 +682,7 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
                if (memcpy_fromiovecend(to, iov, offset, len) < 0)
                        return -EFAULT;
        } else {
-               unsigned int csum = 0;
+               __wsum csum = 0;
                if (csum_partial_copy_fromiovecend(to, iov, offset, len, &csum) < 0)
                        return -EFAULT;
                skb->csum = csum_block_add(skb->csum, csum, odd);
@@ -690,11 +690,11 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
        return 0;
 }
 
-static inline unsigned int
+static inline __wsum
 csum_page(struct page *page, int offset, int copy)
 {
        char *kaddr;
-       unsigned int csum;
+       __wsum csum;
        kaddr = kmap(page);
        csum = csum_partial(kaddr + offset, copy, 0);
        kunmap(page);
@@ -1166,7 +1166,7 @@ ssize_t   ip_append_page(struct sock *sk, struct page *page,
                }
 
                if (skb->ip_summed == CHECKSUM_NONE) {
-                       unsigned int csum;
+                       __wsum csum;
                        csum = csum_page(page, offset, len);
                        skb->csum = csum_block_add(skb->csum, csum, skb->len);
                }
index b43a27828df5d4486d2f397baac2792eb23d4215..2f208c7f4d435aaef980a37795052609940f608d 100644 (file)
@@ -151,8 +151,9 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
  *    each socket state is protected by separate rwlock.
  */
 
-static inline unsigned unix_hash_fold(unsigned hash)
+static inline unsigned unix_hash_fold(__wsum n)
 {
+       unsigned hash = (__force unsigned)n;
        hash ^= hash>>16;
        hash ^= hash>>8;
        return hash&(UNIX_HASH_SIZE-1);