diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-15 00:20:08 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:23:14 -0500 |
commit | a4f89fb7c072b8592b296c2ba216269c0c96db43 (patch) | |
tree | 81ed700573ed0bcf23b99e82ae0b538ac16e62e9 /arch/x86_64/lib/csum-partial.c | |
parent | 9d3d41955845939cb41b87affb039db0bae03b65 (diff) |
[NET]: X86_64 checksum annotations and cleanups.
* sanitize prototypes, annotate
* usual ntohs->shift
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/x86_64/lib/csum-partial.c')
-rw-r--r-- | arch/x86_64/lib/csum-partial.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/lib/csum-partial.c b/arch/x86_64/lib/csum-partial.c index c493735218da..06ae630de82b 100644 --- a/arch/x86_64/lib/csum-partial.c +++ b/arch/x86_64/lib/csum-partial.c | |||
@@ -132,9 +132,10 @@ static __force_inline unsigned do_csum(const unsigned char *buff, unsigned len) | |||
132 | * | 132 | * |
133 | * it's best to have buff aligned on a 64-bit boundary | 133 | * it's best to have buff aligned on a 64-bit boundary |
134 | */ | 134 | */ |
135 | unsigned csum_partial(const unsigned char *buff, unsigned len, unsigned sum) | 135 | __wsum csum_partial(const void *buff, int len, __wsum sum) |
136 | { | 136 | { |
137 | return add32_with_carry(do_csum(buff, len), sum); | 137 | return (__force __wsum)add32_with_carry(do_csum(buff, len), |
138 | (__force u32)sum); | ||
138 | } | 139 | } |
139 | 140 | ||
140 | EXPORT_SYMBOL(csum_partial); | 141 | EXPORT_SYMBOL(csum_partial); |
@@ -143,7 +144,7 @@ EXPORT_SYMBOL(csum_partial); | |||
143 | * this routine is used for miscellaneous IP-like checksums, mainly | 144 | * this routine is used for miscellaneous IP-like checksums, mainly |
144 | * in icmp.c | 145 | * in icmp.c |
145 | */ | 146 | */ |
146 | unsigned short ip_compute_csum(unsigned char * buff, int len) | 147 | __sum16 ip_compute_csum(const void *buff, int len) |
147 | { | 148 | { |
148 | return csum_fold(csum_partial(buff,len,0)); | 149 | return csum_fold(csum_partial(buff,len,0)); |
149 | } | 150 | } |