aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-15 00:19:44 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:23:13 -0500
commit9d3d41955845939cb41b87affb039db0bae03b65 (patch)
tree468f7564a834edb54a30e49dd678e583568c6933 /arch
parentabf419b809bed2333267e4b23dd2b3b4f10da88c (diff)
[NET]: V850 checksum annotations and cleanups.
* sanitize prototypes, annotate * collapse csum_partial_copy * 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')
-rw-r--r--arch/v850/kernel/v850_ksyms.c2
-rw-r--r--arch/v850/lib/checksum.c26
2 files changed, 14 insertions, 14 deletions
diff --git a/arch/v850/kernel/v850_ksyms.c b/arch/v850/kernel/v850_ksyms.c
index 67bc48e57c60..93575fdc874d 100644
--- a/arch/v850/kernel/v850_ksyms.c
+++ b/arch/v850/kernel/v850_ksyms.c
@@ -24,7 +24,7 @@ EXPORT_SYMBOL (kernel_thread);
24EXPORT_SYMBOL (__bug); 24EXPORT_SYMBOL (__bug);
25 25
26/* Networking helper routines. */ 26/* Networking helper routines. */
27EXPORT_SYMBOL (csum_partial_copy); 27EXPORT_SYMBOL (csum_partial_copy_nocheck);
28EXPORT_SYMBOL (csum_partial_copy_from_user); 28EXPORT_SYMBOL (csum_partial_copy_from_user);
29EXPORT_SYMBOL (ip_compute_csum); 29EXPORT_SYMBOL (ip_compute_csum);
30EXPORT_SYMBOL (ip_fast_csum); 30EXPORT_SYMBOL (ip_fast_csum);
diff --git a/arch/v850/lib/checksum.c b/arch/v850/lib/checksum.c
index fa5872633075..042158dfe17a 100644
--- a/arch/v850/lib/checksum.c
+++ b/arch/v850/lib/checksum.c
@@ -88,32 +88,32 @@ out:
88 * This is a version of ip_compute_csum() optimized for IP headers, 88 * This is a version of ip_compute_csum() optimized for IP headers,
89 * which always checksum on 4 octet boundaries. 89 * which always checksum on 4 octet boundaries.
90 */ 90 */
91unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) 91__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
92{ 92{
93 return ~do_csum(iph,ihl*4); 93 return (__force __sum16)~do_csum(iph,ihl*4);
94} 94}
95 95
96/* 96/*
97 * this routine is used for miscellaneous IP-like checksums, mainly 97 * this routine is used for miscellaneous IP-like checksums, mainly
98 * in icmp.c 98 * in icmp.c
99 */ 99 */
100unsigned short ip_compute_csum(const unsigned char * buff, int len) 100__sum16 ip_compute_csum(const void *buff, int len)
101{ 101{
102 return ~do_csum(buff,len); 102 return (__force __sum16)~do_csum(buff,len);
103} 103}
104 104
105/* 105/*
106 * computes a partial checksum, e.g. for TCP/UDP fragments 106 * computes a partial checksum, e.g. for TCP/UDP fragments
107 */ 107 */
108unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) 108__wsum csum_partial(const void *buff, int len, __wsum sum)
109{ 109{
110 unsigned int result = do_csum(buff, len); 110 unsigned int result = do_csum(buff, len);
111 111
112 /* add in old sum, and carry.. */ 112 /* add in old sum, and carry.. */
113 result += sum; 113 result += (__force u32)sum;
114 if(sum > result) 114 if ((__force u32)sum > result)
115 result += 1; 115 result += 1;
116 return result; 116 return (__force __wsum)result;
117} 117}
118 118
119EXPORT_SYMBOL(csum_partial); 119EXPORT_SYMBOL(csum_partial);
@@ -121,8 +121,8 @@ EXPORT_SYMBOL(csum_partial);
121/* 121/*
122 * copy while checksumming, otherwise like csum_partial 122 * copy while checksumming, otherwise like csum_partial
123 */ 123 */
124unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, 124__wsum csum_partial_copy_nocheck(const void *src, void *dst,
125 int len, unsigned int sum) 125 int len, __wsum sum)
126{ 126{
127 /* 127 /*
128 * It's 2:30 am and I don't feel like doing it real ... 128 * It's 2:30 am and I don't feel like doing it real ...
@@ -138,9 +138,9 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
138 * Copy from userspace and compute checksum. If we catch an exception 138 * Copy from userspace and compute checksum. If we catch an exception
139 * then zero the rest of the buffer. 139 * then zero the rest of the buffer.
140 */ 140 */
141unsigned int csum_partial_copy_from_user (const unsigned char *src, 141__wsum csum_partial_copy_from_user (const void *src,
142 unsigned char *dst, 142 void *dst,
143 int len, unsigned int sum, 143 int len, __wsum sum,
144 int *err_ptr) 144 int *err_ptr)
145{ 145{
146 int missing; 146 int missing;