Commit cc44c17b authored by Al Viro's avatar Al Viro
Browse files

csum_partial_copy_nocheck(): drop the last argument



It's always 0.  Note that we theoretically could use ~0U as well -
result will be the same modulo 0xffff, _if_ the damn thing did the
right thing for any value of initial sum; later we'll make use of
that when convenient.

However, unlike csum_and_copy_..._user(), there are instances that
did not work for arbitrary initial sums; c6x is one such.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 6e41c585
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ extern __wsum csum_partial(const void *buff, int len, __wsum sum);
#define _HAVE_ARCH_CSUM_AND_COPY
__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);
__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len);


/*
+2 −2
Original line number Diff line number Diff line
@@ -372,13 +372,13 @@ csum_and_copy_from_user(const void __user *src, void *dst, int len,
EXPORT_SYMBOL(csum_and_copy_from_user);

__wsum
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
csum_partial_copy_nocheck(const void *src, void *dst, int len)
{
	__wsum checksum;
	mm_segment_t oldfs = get_fs();
	set_fs(KERNEL_DS);
	checksum = csum_and_copy_from_user((__force const void __user *)src,
						dst, len, sum, NULL);
						dst, len, 0, NULL);
	set_fs(oldfs);
	return checksum;
}
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ __wsum csum_partial(const void *buff, int len, __wsum sum);
 */

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

__wsum
csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
+3 −2
Original line number Diff line number Diff line
@@ -9,13 +9,14 @@

		.text

/* Function: __u32 csum_partial_copy_nocheck(const char *src, char *dst, int len, __u32 sum)
 * Params  : r0 = src, r1 = dst, r2 = len, r3 = checksum
/* Function: __u32 csum_partial_copy_nocheck(const char *src, char *dst, int len)
 * Params  : r0 = src, r1 = dst, r2 = len
 * Returns : r0 = new checksum
 */

		.macro	save_regs
		stmfd	sp!, {r1, r4 - r8, lr}
		mov	r3, #0
		.endm

		.macro	load_regs
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len,
#define csum_tcpudp_nofold csum_tcpudp_nofold

#define _HAVE_ARCH_CSUM_AND_COPY
extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len);

#include <asm-generic/checksum.h>

Loading