Linux 5.7.6
[linux/fpc-iii.git] / arch / c6x / lib / checksum.c
blob46940844c553feff86bf18ca8115ba89fe6afe8e
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 */
4 #include <linux/module.h>
5 #include <net/checksum.h>
7 #include <asm/byteorder.h>
9 /*
10 * copy from fs while checksumming, otherwise like csum_partial
12 __wsum
13 csum_partial_copy_from_user(const void __user *src, void *dst, int len,
14 __wsum sum, int *csum_err)
16 int missing;
18 missing = __copy_from_user(dst, src, len);
19 if (missing) {
20 memset(dst + len - missing, 0, missing);
21 *csum_err = -EFAULT;
22 } else
23 *csum_err = 0;
25 return csum_partial(dst, len, sum);
27 EXPORT_SYMBOL(csum_partial_copy_from_user);
29 /* These are from csum_64plus.S */
30 EXPORT_SYMBOL(csum_partial);
31 EXPORT_SYMBOL(csum_partial_copy);
32 EXPORT_SYMBOL(ip_compute_csum);
33 EXPORT_SYMBOL(ip_fast_csum);