Skip to content

Commit 1cd95ab

Browse files
author
Al Viro
committed
mips: propagate the calling convention change down into __csum_partial_copy_..._user()
and turn the exception handlers into simply returning 0, which simplifies the hell out of things in csum_partial.S Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent f863c65 commit 1cd95ab

2 files changed

Lines changed: 89 additions & 195 deletions

File tree

‎arch/mips/include/asm/checksum.h‎

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,17 @@
3434
*/
3535
__wsum csum_partial(const void *buff, int len, __wsum sum);
3636

37-
__wsum __csum_partial_copy_from_user(const void *src, void *dst,
38-
int len, __wsum sum, int *err_ptr);
39-
__wsum __csum_partial_copy_to_user(const void *src, void *dst,
40-
int len, __wsum sum, int *err_ptr);
37+
__wsum __csum_partial_copy_from_user(const void __user *src, void *dst, int len);
38+
__wsum __csum_partial_copy_to_user(const void *src, void __user *dst, int len);
4139

4240
#define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
4341
static inline
4442
__wsum csum_and_copy_from_user(const void __user *src, void *dst, int len)
4543
{
46-
__wsum sum = ~0U;
47-
int err = 0;
48-
4944
might_fault();
50-
5145
if (!access_ok(src, len))
5246
return 0;
53-
sum = __csum_partial_copy_from_user((__force void *)src, dst,
54-
len, sum, &err);
55-
return err ? 0 : sum;
47+
return __csum_partial_copy_from_user(src, dst, len);
5648
}
5749

5850
/*
@@ -62,27 +54,21 @@ __wsum csum_and_copy_from_user(const void __user *src, void *dst, int len)
6254
static inline
6355
__wsum csum_and_copy_to_user(const void *src, void __user *dst, int len)
6456
{
65-
int err = 0;
66-
__wsum sum = ~0U;
67-
6857
might_fault();
6958
if (!access_ok(dst, len))
7059
return 0;
71-
sum = __csum_partial_copy_to_user(src,
72-
(__force void *)dst,
73-
len, sum, &err);
74-
return err ? 0 : sum;
60+
return __csum_partial_copy_to_user(src, dst, len);
7561
}
7662

7763
/*
7864
* the same as csum_partial, but copies from user space (but on MIPS
7965
* we have just one address space, so this is identical to the above)
8066
*/
8167
#define _HAVE_ARCH_CSUM_AND_COPY
82-
__wsum __csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
68+
__wsum __csum_partial_copy_nocheck(const void *src, void *dst, int len);
8369
static inline __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len)
8470
{
85-
return __csum_partial_copy_nocheck(src, dst, len, 0);
71+
return __csum_partial_copy_nocheck(src, dst, len);
8672
}
8773

8874
/*

0 commit comments

Comments
 (0)