Skip to content

Commit

Permalink
alpha: turn csum_partial_copy_from_user() into csum_and_copy_from_user()
Browse files Browse the repository at this point in the history
It's already doing the right thing - it does access_ok() and the wrapper
in net/checksum.h is pointless here.  Just rename it and be done with that...

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed May 29, 2020
1 parent bfdaf02 commit 808b49d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion arch/alpha/include/asm/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ extern __wsum csum_partial(const void *buff, int len, __wsum sum);
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *errp);
#define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
__wsum csum_and_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *errp);

__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);

Expand Down
6 changes: 3 additions & 3 deletions arch/alpha/lib/csum_partial_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ csum_partial_cfu_unaligned(const unsigned long __user * src,
}

__wsum
csum_partial_copy_from_user(const void __user *src, void *dst, int len,
csum_and_copy_from_user(const void __user *src, void *dst, int len,
__wsum sum, int *errp)
{
unsigned long checksum = (__force u32) sum;
Expand Down Expand Up @@ -369,15 +369,15 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
}
return (__force __wsum)checksum;
}
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)
{
__wsum checksum;
mm_segment_t oldfs = get_fs();
set_fs(KERNEL_DS);
checksum = csum_partial_copy_from_user((__force const void __user *)src,
checksum = csum_and_copy_from_user((__force const void __user *)src,
dst, len, sum, NULL);
set_fs(oldfs);
return checksum;
Expand Down

0 comments on commit 808b49d

Please sign in to comment.