aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-15 00:36:14 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:23:32 -0500
commit44bb93633f57a55979f3c2589b10fd6a2bfc7c08 (patch)
tree09dff6f9e3c9d21c8d06f3a1ec73609a1942c9da
parent868c86bcb5bdea7ed8d45979b17bb919af9254db (diff)
[NET]: Annotate csum_partial() callers in net/*
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/sunrpc/xdr.h2
-rw-r--r--net/core/iovec.c4
-rw-r--r--net/core/skbuff.c2
-rw-r--r--net/ipv4/ip_output.c8
-rw-r--r--net/unix/af_unix.c3
6 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 592b66679823..92cd38efad7f 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -293,7 +293,7 @@ extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov,
293extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 293extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
294 struct iovec *iov, 294 struct iovec *iov,
295 int offset, 295 int offset,
296 unsigned int len, int *csump); 296 unsigned int len, __wsum *csump);
297 297
298extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); 298extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
299extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 299extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index ac69e5511606..9a527c364394 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -151,7 +151,7 @@ typedef struct {
151 struct sk_buff *skb; 151 struct sk_buff *skb;
152 unsigned int offset; 152 unsigned int offset;
153 size_t count; 153 size_t count;
154 unsigned int csum; 154 __wsum csum;
155} skb_reader_t; 155} skb_reader_t;
156 156
157typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 157typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
diff --git a/net/core/iovec.c b/net/core/iovec.c
index 65e4b56fbc77..04b249c40b5b 100644
--- a/net/core/iovec.c
+++ b/net/core/iovec.c
@@ -158,9 +158,9 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset,
158 * call to this function will be unaligned also. 158 * call to this function will be unaligned also.
159 */ 159 */
160int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov, 160int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
161 int offset, unsigned int len, int *csump) 161 int offset, unsigned int len, __wsum *csump)
162{ 162{
163 int csum = *csump; 163 __wsum csum = *csump;
164 int partial_cnt = 0, err = 0; 164 int partial_cnt = 0, err = 0;
165 165
166 /* Skip over the finished iovecs */ 166 /* Skip over the finished iovecs */
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index dfa02cc8d687..c0e3427057fc 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1265,7 +1265,7 @@ unsigned int skb_checksum(const struct sk_buff *skb, int offset,
1265 1265
1266 end = start + skb_shinfo(skb)->frags[i].size; 1266 end = start + skb_shinfo(skb)->frags[i].size;
1267 if ((copy = end - offset) > 0) { 1267 if ((copy = end - offset) > 0) {
1268 unsigned int csum2; 1268 __wsum csum2;
1269 u8 *vaddr; 1269 u8 *vaddr;
1270 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1270 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1271 1271
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 5f3e35c03637..f9194f7e39d3 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -682,7 +682,7 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
682 if (memcpy_fromiovecend(to, iov, offset, len) < 0) 682 if (memcpy_fromiovecend(to, iov, offset, len) < 0)
683 return -EFAULT; 683 return -EFAULT;
684 } else { 684 } else {
685 unsigned int csum = 0; 685 __wsum csum = 0;
686 if (csum_partial_copy_fromiovecend(to, iov, offset, len, &csum) < 0) 686 if (csum_partial_copy_fromiovecend(to, iov, offset, len, &csum) < 0)
687 return -EFAULT; 687 return -EFAULT;
688 skb->csum = csum_block_add(skb->csum, csum, odd); 688 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
690 return 0; 690 return 0;
691} 691}
692 692
693static inline unsigned int 693static inline __wsum
694csum_page(struct page *page, int offset, int copy) 694csum_page(struct page *page, int offset, int copy)
695{ 695{
696 char *kaddr; 696 char *kaddr;
697 unsigned int csum; 697 __wsum csum;
698 kaddr = kmap(page); 698 kaddr = kmap(page);
699 csum = csum_partial(kaddr + offset, copy, 0); 699 csum = csum_partial(kaddr + offset, copy, 0);
700 kunmap(page); 700 kunmap(page);
@@ -1166,7 +1166,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1166 } 1166 }
1167 1167
1168 if (skb->ip_summed == CHECKSUM_NONE) { 1168 if (skb->ip_summed == CHECKSUM_NONE) {
1169 unsigned int csum; 1169 __wsum csum;
1170 csum = csum_page(page, offset, len); 1170 csum = csum_page(page, offset, len);
1171 skb->csum = csum_block_add(skb->csum, csum, skb->len); 1171 skb->csum = csum_block_add(skb->csum, csum, skb->len);
1172 } 1172 }
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index b43a27828df5..2f208c7f4d43 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -151,8 +151,9 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
151 * each socket state is protected by separate rwlock. 151 * each socket state is protected by separate rwlock.
152 */ 152 */
153 153
154static inline unsigned unix_hash_fold(unsigned hash) 154static inline unsigned unix_hash_fold(__wsum n)
155{ 155{
156 unsigned hash = (__force unsigned)n;
156 hash ^= hash>>16; 157 hash ^= hash>>16;
157 hash ^= hash>>8; 158 hash ^= hash>>8;
158 return hash&(UNIX_HASH_SIZE-1); 159 return hash&(UNIX_HASH_SIZE-1);