aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv/lib/checksum.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/frv/lib/checksum.c')
-rw-r--r--arch/frv/lib/checksum.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/frv/lib/checksum.c b/arch/frv/lib/checksum.c
index 20e7dfc474ef..44e16d59bc10 100644
--- a/arch/frv/lib/checksum.c
+++ b/arch/frv/lib/checksum.c
@@ -32,7 +32,6 @@
32 of the assembly has to go. */ 32 of the assembly has to go. */
33 33
34#include <net/checksum.h> 34#include <net/checksum.h>
35#include <asm/checksum.h>
36#include <linux/module.h> 35#include <linux/module.h>
37 36
38static inline unsigned short from32to16(unsigned long x) 37static inline unsigned short from32to16(unsigned long x)
@@ -105,15 +104,15 @@ out:
105 * 104 *
106 * it's best to have buff aligned on a 32-bit boundary 105 * it's best to have buff aligned on a 32-bit boundary
107 */ 106 */
108unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) 107__wsum csum_partial(const void *buff, int len, __wsum sum)
109{ 108{
110 unsigned int result = do_csum(buff, len); 109 unsigned int result = do_csum(buff, len);
111 110
112 /* add in old sum, and carry.. */ 111 /* add in old sum, and carry.. */
113 result += sum; 112 result += (__force u32)sum;
114 if (sum > result) 113 if ((__force u32)sum > result)
115 result += 1; 114 result += 1;
116 return result; 115 return (__force __wsum)result;
117} 116}
118 117
119EXPORT_SYMBOL(csum_partial); 118EXPORT_SYMBOL(csum_partial);
@@ -122,9 +121,9 @@ EXPORT_SYMBOL(csum_partial);
122 * this routine is used for miscellaneous IP-like checksums, mainly 121 * this routine is used for miscellaneous IP-like checksums, mainly
123 * in icmp.c 122 * in icmp.c
124 */ 123 */
125unsigned short ip_compute_csum(const unsigned char * buff, int len) 124__sum16 ip_compute_csum(const void *buff, int len)
126{ 125{
127 return ~do_csum(buff, len); 126 return (__force __sum16)~do_csum(buff, len);
128} 127}
129 128
130EXPORT_SYMBOL(ip_compute_csum); 129EXPORT_SYMBOL(ip_compute_csum);
@@ -132,9 +131,9 @@ EXPORT_SYMBOL(ip_compute_csum);
132/* 131/*
133 * copy from fs while checksumming, otherwise like csum_partial 132 * copy from fs while checksumming, otherwise like csum_partial
134 */ 133 */
135unsigned int 134__wsum
136csum_partial_copy_from_user(const char __user *src, char *dst, 135csum_partial_copy_from_user(const void __user *src, void *dst,
137 int len, int sum, int *csum_err) 136 int len, __wsum sum, int *csum_err)
138{ 137{
139 int rem; 138 int rem;
140 139
@@ -157,11 +156,11 @@ EXPORT_SYMBOL(csum_partial_copy_from_user);
157/* 156/*
158 * copy from ds while checksumming, otherwise like csum_partial 157 * copy from ds while checksumming, otherwise like csum_partial
159 */ 158 */
160unsigned int 159__wsum
161csum_partial_copy(const char *src, char *dst, int len, int sum) 160csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
162{ 161{
163 memcpy(dst, src, len); 162 memcpy(dst, src, len);
164 return csum_partial(dst, len, sum); 163 return csum_partial(dst, len, sum);
165} 164}
166 165
167EXPORT_SYMBOL(csum_partial_copy); 166EXPORT_SYMBOL(csum_partial_copy_nocheck);