aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/lib/csum_partial_copy.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-12-12 17:41:41 -0500
committerDave Jones <davej@redhat.com>2006-12-12 17:41:41 -0500
commitc4366889dda8110247be59ca41fddb82951a8c26 (patch)
tree705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /arch/ia64/lib/csum_partial_copy.c
parentdb2fb9db5735cc532fd4fc55e94b9a3c3750378e (diff)
parente1036502e5263851259d147771226161e5ccc85a (diff)
Merge ../linus
Conflicts: drivers/cpufreq/cpufreq.c
Diffstat (limited to 'arch/ia64/lib/csum_partial_copy.c')
-rw-r--r--arch/ia64/lib/csum_partial_copy.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/arch/ia64/lib/csum_partial_copy.c b/arch/ia64/lib/csum_partial_copy.c
index 36866e8a5d2b..503dfe6d1450 100644
--- a/arch/ia64/lib/csum_partial_copy.c
+++ b/arch/ia64/lib/csum_partial_copy.c
@@ -104,9 +104,9 @@ out:
104 */ 104 */
105extern unsigned long do_csum(const unsigned char *, long); 105extern unsigned long do_csum(const unsigned char *, long);
106 106
107static unsigned int 107__wsum
108do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst, 108csum_partial_copy_from_user(const void __user *src, void *dst,
109 int len, unsigned int psum, int *errp) 109 int len, __wsum psum, int *errp)
110{ 110{
111 unsigned long result; 111 unsigned long result;
112 112
@@ -122,30 +122,17 @@ do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *
122 result = do_csum(dst, len); 122 result = do_csum(dst, len);
123 123
124 /* add in old sum, and carry.. */ 124 /* add in old sum, and carry.. */
125 result += psum; 125 result += (__force u32)psum;
126 /* 32+c bits -> 32 bits */ 126 /* 32+c bits -> 32 bits */
127 result = (result & 0xffffffff) + (result >> 32); 127 result = (result & 0xffffffff) + (result >> 32);
128 return result; 128 return (__force __wsum)result;
129}
130
131unsigned int
132csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst,
133 int len, unsigned int sum, int *errp)
134{
135 if (!access_ok(VERIFY_READ, src, len)) {
136 *errp = -EFAULT;
137 memset(dst, 0, len);
138 return sum;
139 }
140
141 return do_csum_partial_copy_from_user(src, dst, len, sum, errp);
142} 129}
143 130
144unsigned int 131__wsum
145csum_partial_copy_nocheck(const unsigned char __user *src, unsigned char *dst, 132csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
146 int len, unsigned int sum)
147{ 133{
148 return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); 134 return csum_partial_copy_from_user((__force const void __user *)src,
135 dst, len, sum, NULL);
149} 136}
150 137
151EXPORT_SYMBOL(csum_partial_copy_nocheck); 138EXPORT_SYMBOL(csum_partial_copy_nocheck);