diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-16 01:07:24 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-16 01:07:24 +0000 |
commit | 95db6b748fc86297827fbd9c9ef174d491c9ad89 (patch) | |
tree | 27a92a942821cde1edda9a1b088718d436b3efe4 /include/asm-mips64/checksum.h | |
parent | 45b27b0a0652331d104c953a5b192d843fff88f8 (diff) |
Merge with Linux 2.3.40.
Diffstat (limited to 'include/asm-mips64/checksum.h')
-rw-r--r-- | include/asm-mips64/checksum.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/asm-mips64/checksum.h b/include/asm-mips64/checksum.h index 5c928cfb5..7d389ed21 100644 --- a/include/asm-mips64/checksum.h +++ b/include/asm-mips64/checksum.h @@ -1,4 +1,4 @@ -/* $Id: checksum.h,v 1.3 1999/11/19 20:35:48 ralf Exp $ +/* $Id: checksum.h,v 1.3 1999/11/19 23:22:59 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -37,9 +37,23 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *errp); +/* + * Copy and checksum to user + */ #define HAVE_CSUM_COPY_USER -unsigned int csum_and_copy_to_user (const char *src, char *dst, - int len, int sum, int *err_ptr); +extern inline unsigned int +csum_and_copy_to_user (const char *src, char *dst, + int len, int sum, int *err_ptr) +{ + sum = csum_partial(src, len, sum); + + if (copy_to_user(dst, src, len)) { + *err_ptr = -EFAULT; + return -1; + } + + return sum; +} /* * the same as csum_partial, but copies from user space (but on MIPS |