diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-14 21:18:39 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-02 21:23:10 -0800 |
commit | 7814e4b6d6ce59071887600a8659641ba3d30a43 (patch) | |
tree | 494eb459dc88f208806f6e3bdbbc212d6157ef3d /arch/parisc/lib | |
parent | 8e3d8433d8c22ca6c42cba4a67d300c39aae7822 (diff) | |
download | kernel_samsung_espresso10-7814e4b6d6ce59071887600a8659641ba3d30a43.zip kernel_samsung_espresso10-7814e4b6d6ce59071887600a8659641ba3d30a43.tar.gz kernel_samsung_espresso10-7814e4b6d6ce59071887600a8659641ba3d30a43.tar.bz2 |
[NET]: PARISC checksum annotations and cleanups.
* sanitized prototypes, annotated
* kill shift-by-16 in checksum calculation
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/parisc/lib')
-rw-r--r-- | arch/parisc/lib/checksum.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c index 8a1e080..462696d 100644 --- a/arch/parisc/lib/checksum.c +++ b/arch/parisc/lib/checksum.c @@ -101,11 +101,14 @@ out: /* * computes a partial checksum, e.g. for TCP/UDP fragments */ -unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) +/* + * why bother folding? + */ +__wsum csum_partial(const void *buff, int len, __wsum sum) { unsigned int result = do_csum(buff, len); addc(result, sum); - return from32to16(result); + return (__force __wsum)from32to16(result); } EXPORT_SYMBOL(csum_partial); @@ -113,8 +116,8 @@ EXPORT_SYMBOL(csum_partial); /* * copy while checksumming, otherwise like csum_partial */ -unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, - int len, unsigned int sum) +__wsum csum_partial_copy_nocheck(const void *src, void *dst, + int len, __wsum sum) { /* * It's 2:30 am and I don't feel like doing it real ... @@ -131,9 +134,9 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck); * Copy from userspace and compute checksum. If we catch an exception * then zero the rest of the buffer. */ -unsigned int csum_partial_copy_from_user(const unsigned char __user *src, - unsigned char *dst, int len, - unsigned int sum, int *err_ptr) +__wsum csum_partial_copy_from_user(const void __user *src, + void *dst, int len, + __wsum sum, int *err_ptr) { int missing; |