Skip to content

Commit

Permalink
[NET]: Annotate csum_partial() callers in net/*
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent 868c86b commit 44bb936
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/linux/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/sunrpc/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions net/core/iovec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
8 changes: 4 additions & 4 deletions net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,19 +682,19 @@ 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);
}
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);
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44bb936

Please sign in to comment.