summaryrefslogtreecommitdiffstats
path: root/arch/ia64/lib
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-02-18 12:56:09 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-29 16:11:48 -0400
commitbfdaf029c9c95072359fd0870c282e53953220f6 (patch)
tree028cb7c8c27e0df0a95ed325658c1c9db2657424 /arch/ia64/lib
parentcc03f19cfd45f44a75f0445c5be0073bbd3dda1c (diff)
downloadlinux-bfdaf029c9c95072359fd0870c282e53953220f6.tar.bz2
ia64: turn csum_partial_copy_from_user() into csum_and_copy_from_user()
Just use copy_from_user() there, rather than relying upon the wrapper to have done access_ok() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/ia64/lib')
-rw-r--r--arch/ia64/lib/csum_partial_copy.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/arch/ia64/lib/csum_partial_copy.c b/arch/ia64/lib/csum_partial_copy.c
index 9ab570d0f756..ab59eb399900 100644
--- a/arch/ia64/lib/csum_partial_copy.c
+++ b/arch/ia64/lib/csum_partial_copy.c
@@ -103,33 +103,23 @@ out:
* This is very ugly but temporary. THIS NEEDS SERIOUS ENHANCEMENTS.
* But it's very tricky to get right even in C.
*/
-extern unsigned long do_csum(const unsigned char *, long);
-
__wsum
-csum_partial_copy_from_user(const void __user *src, void *dst,
+csum_and_copy_from_user(const void __user *src, void *dst,
int len, __wsum psum, int *errp)
{
- unsigned long result;
-
/* XXX Fixme
* for now we separate the copy from checksum for obvious
* alignment difficulties. Look at the Alpha code and you'll be
* scared.
*/
- if (__copy_from_user(dst, src, len) != 0 && errp)
+ if (copy_from_user(dst, src, len))
*errp = -EFAULT;
- result = do_csum(dst, len);
-
- /* add in old sum, and carry.. */
- result += (__force u32)psum;
- /* 32+c bits -> 32 bits */
- result = (result & 0xffffffff) + (result >> 32);
- return (__force __wsum)result;
+ return csum_partial(dst, len, psum);
}
-EXPORT_SYMBOL(csum_partial_copy_from_user);
+EXPORT_SYMBOL(csum_and_copy_from_user);
__wsum
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)