aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-15 00:18:39 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:23:10 -0500
commit7814e4b6d6ce59071887600a8659641ba3d30a43 (patch)
tree494eb459dc88f208806f6e3bdbbc212d6157ef3d /arch
parent8e3d8433d8c22ca6c42cba4a67d300c39aae7822 (diff)
[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')
-rw-r--r--arch/parisc/lib/checksum.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c
index 8a1e08068e7d..462696d30d3b 100644
--- a/arch/parisc/lib/checksum.c
+++ b/arch/parisc/lib/checksum.c
@@ -101,11 +101,14 @@ out:
101/* 101/*
102 * computes a partial checksum, e.g. for TCP/UDP fragments 102 * computes a partial checksum, e.g. for TCP/UDP fragments
103 */ 103 */
104unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) 104/*
105 * why bother folding?
106 */
107__wsum csum_partial(const void *buff, int len, __wsum sum)
105{ 108{
106 unsigned int result = do_csum(buff, len); 109 unsigned int result = do_csum(buff, len);
107 addc(result, sum); 110 addc(result, sum);
108 return from32to16(result); 111 return (__force __wsum)from32to16(result);
109} 112}
110 113
111EXPORT_SYMBOL(csum_partial); 114EXPORT_SYMBOL(csum_partial);
@@ -113,8 +116,8 @@ EXPORT_SYMBOL(csum_partial);
113/* 116/*
114 * copy while checksumming, otherwise like csum_partial 117 * copy while checksumming, otherwise like csum_partial
115 */ 118 */
116unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, 119__wsum csum_partial_copy_nocheck(const void *src, void *dst,
117 int len, unsigned int sum) 120 int len, __wsum sum)
118{ 121{
119 /* 122 /*
120 * It's 2:30 am and I don't feel like doing it real ... 123 * It's 2:30 am and I don't feel like doing it real ...
@@ -131,9 +134,9 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
131 * Copy from userspace and compute checksum. If we catch an exception 134 * Copy from userspace and compute checksum. If we catch an exception
132 * then zero the rest of the buffer. 135 * then zero the rest of the buffer.
133 */ 136 */
134unsigned int csum_partial_copy_from_user(const unsigned char __user *src, 137__wsum csum_partial_copy_from_user(const void __user *src,
135 unsigned char *dst, int len, 138 void *dst, int len,
136 unsigned int sum, int *err_ptr) 139 __wsum sum, int *err_ptr)
137{ 140{
138 int missing; 141 int missing;
139 142