Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
[linux/fpc-iii.git] / arch / c6x / lib / checksum.c
blob67cc93b0b932b1e7893ea10584ad490c105c8221
1 /*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version
5 * 2 of the License, or (at your option) any later version.
6 */
7 #include <linux/module.h>
8 #include <net/checksum.h>
10 #include <asm/byteorder.h>
13 * copy from fs while checksumming, otherwise like csum_partial
15 __wsum
16 csum_partial_copy_from_user(const void __user *src, void *dst, int len,
17 __wsum sum, int *csum_err)
19 int missing;
21 missing = __copy_from_user(dst, src, len);
22 if (missing) {
23 memset(dst + len - missing, 0, missing);
24 *csum_err = -EFAULT;
25 } else
26 *csum_err = 0;
28 return csum_partial(dst, len, sum);
30 EXPORT_SYMBOL(csum_partial_copy_from_user);
32 /* These are from csum_64plus.S */
33 EXPORT_SYMBOL(csum_partial);
34 EXPORT_SYMBOL(csum_partial_copy);
35 EXPORT_SYMBOL(ip_compute_csum);
36 EXPORT_SYMBOL(ip_fast_csum);