diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-15 00:15:40 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:23:03 -0500 |
commit | 8042c44b8a6171ed75b7dd6a224df18d993f6094 (patch) | |
tree | 835f0a215101d84126618d5d939410ad9684a886 /arch/frv/lib | |
parent | 3532010bcf7699f2ce9a2baab58b4b9a5426d97e (diff) |
[NET]: FRV checksum annotations.
* sanitize prototypes and annotate
* collapse csum_partial_copy
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/frv/lib')
-rw-r--r-- | arch/frv/lib/checksum.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/frv/lib/checksum.c b/arch/frv/lib/checksum.c index 2581a960d58f..44e16d59bc10 100644 --- a/arch/frv/lib/checksum.c +++ b/arch/frv/lib/checksum.c | |||
@@ -104,15 +104,15 @@ out: | |||
104 | * | 104 | * |
105 | * it's best to have buff aligned on a 32-bit boundary | 105 | * it's best to have buff aligned on a 32-bit boundary |
106 | */ | 106 | */ |
107 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | 107 | __wsum csum_partial(const void *buff, int len, __wsum sum) |
108 | { | 108 | { |
109 | unsigned int result = do_csum(buff, len); | 109 | unsigned int result = do_csum(buff, len); |
110 | 110 | ||
111 | /* add in old sum, and carry.. */ | 111 | /* add in old sum, and carry.. */ |
112 | result += sum; | 112 | result += (__force u32)sum; |
113 | if (sum > result) | 113 | if ((__force u32)sum > result) |
114 | result += 1; | 114 | result += 1; |
115 | return result; | 115 | return (__force __wsum)result; |
116 | } | 116 | } |
117 | 117 | ||
118 | EXPORT_SYMBOL(csum_partial); | 118 | EXPORT_SYMBOL(csum_partial); |
@@ -121,9 +121,9 @@ EXPORT_SYMBOL(csum_partial); | |||
121 | * this routine is used for miscellaneous IP-like checksums, mainly | 121 | * this routine is used for miscellaneous IP-like checksums, mainly |
122 | * in icmp.c | 122 | * in icmp.c |
123 | */ | 123 | */ |
124 | unsigned short ip_compute_csum(const unsigned char * buff, int len) | 124 | __sum16 ip_compute_csum(const void *buff, int len) |
125 | { | 125 | { |
126 | return ~do_csum(buff, len); | 126 | return (__force __sum16)~do_csum(buff, len); |
127 | } | 127 | } |
128 | 128 | ||
129 | EXPORT_SYMBOL(ip_compute_csum); | 129 | EXPORT_SYMBOL(ip_compute_csum); |
@@ -131,9 +131,9 @@ EXPORT_SYMBOL(ip_compute_csum); | |||
131 | /* | 131 | /* |
132 | * copy from fs while checksumming, otherwise like csum_partial | 132 | * copy from fs while checksumming, otherwise like csum_partial |
133 | */ | 133 | */ |
134 | unsigned int | 134 | __wsum |
135 | csum_partial_copy_from_user(const char __user *src, char *dst, | 135 | csum_partial_copy_from_user(const void __user *src, void *dst, |
136 | int len, int sum, int *csum_err) | 136 | int len, __wsum sum, int *csum_err) |
137 | { | 137 | { |
138 | int rem; | 138 | int rem; |
139 | 139 | ||
@@ -156,11 +156,11 @@ EXPORT_SYMBOL(csum_partial_copy_from_user); | |||
156 | /* | 156 | /* |
157 | * copy from ds while checksumming, otherwise like csum_partial | 157 | * copy from ds while checksumming, otherwise like csum_partial |
158 | */ | 158 | */ |
159 | unsigned int | 159 | __wsum |
160 | csum_partial_copy(const char *src, char *dst, int len, int sum) | 160 | csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) |
161 | { | 161 | { |
162 | memcpy(dst, src, len); | 162 | memcpy(dst, src, len); |
163 | return csum_partial(dst, len, sum); | 163 | return csum_partial(dst, len, sum); |
164 | } | 164 | } |
165 | 165 | ||
166 | EXPORT_SYMBOL(csum_partial_copy); | 166 | EXPORT_SYMBOL(csum_partial_copy_nocheck); |