diff options
Diffstat (limited to 'arch/v850/lib/checksum.c')
| -rw-r--r-- | arch/v850/lib/checksum.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/v850/lib/checksum.c b/arch/v850/lib/checksum.c index fa5872633075..042158dfe17a 100644 --- a/arch/v850/lib/checksum.c +++ b/arch/v850/lib/checksum.c | |||
| @@ -88,32 +88,32 @@ out: | |||
| 88 | * This is a version of ip_compute_csum() optimized for IP headers, | 88 | * This is a version of ip_compute_csum() optimized for IP headers, |
| 89 | * which always checksum on 4 octet boundaries. | 89 | * which always checksum on 4 octet boundaries. |
| 90 | */ | 90 | */ |
| 91 | unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) | 91 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
| 92 | { | 92 | { |
| 93 | return ~do_csum(iph,ihl*4); | 93 | return (__force __sum16)~do_csum(iph,ihl*4); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | /* | 96 | /* |
| 97 | * this routine is used for miscellaneous IP-like checksums, mainly | 97 | * this routine is used for miscellaneous IP-like checksums, mainly |
| 98 | * in icmp.c | 98 | * in icmp.c |
| 99 | */ | 99 | */ |
| 100 | unsigned short ip_compute_csum(const unsigned char * buff, int len) | 100 | __sum16 ip_compute_csum(const void *buff, int len) |
| 101 | { | 101 | { |
| 102 | return ~do_csum(buff,len); | 102 | return (__force __sum16)~do_csum(buff,len); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | /* | 105 | /* |
| 106 | * computes a partial checksum, e.g. for TCP/UDP fragments | 106 | * computes a partial checksum, e.g. for TCP/UDP fragments |
| 107 | */ | 107 | */ |
| 108 | unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) | 108 | __wsum csum_partial(const void *buff, int len, __wsum sum) |
| 109 | { | 109 | { |
| 110 | unsigned int result = do_csum(buff, len); | 110 | unsigned int result = do_csum(buff, len); |
| 111 | 111 | ||
| 112 | /* add in old sum, and carry.. */ | 112 | /* add in old sum, and carry.. */ |
| 113 | result += sum; | 113 | result += (__force u32)sum; |
| 114 | if(sum > result) | 114 | if ((__force u32)sum > result) |
| 115 | result += 1; | 115 | result += 1; |
| 116 | return result; | 116 | return (__force __wsum)result; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | EXPORT_SYMBOL(csum_partial); | 119 | EXPORT_SYMBOL(csum_partial); |
| @@ -121,8 +121,8 @@ EXPORT_SYMBOL(csum_partial); | |||
| 121 | /* | 121 | /* |
| 122 | * copy while checksumming, otherwise like csum_partial | 122 | * copy while checksumming, otherwise like csum_partial |
| 123 | */ | 123 | */ |
| 124 | unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | 124 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
| 125 | int len, unsigned int sum) | 125 | int len, __wsum sum) |
| 126 | { | 126 | { |
| 127 | /* | 127 | /* |
| 128 | * It's 2:30 am and I don't feel like doing it real ... | 128 | * It's 2:30 am and I don't feel like doing it real ... |
| @@ -138,9 +138,9 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | |||
| 138 | * Copy from userspace and compute checksum. If we catch an exception | 138 | * Copy from userspace and compute checksum. If we catch an exception |
| 139 | * then zero the rest of the buffer. | 139 | * then zero the rest of the buffer. |
| 140 | */ | 140 | */ |
| 141 | unsigned int csum_partial_copy_from_user (const unsigned char *src, | 141 | __wsum csum_partial_copy_from_user (const void *src, |
| 142 | unsigned char *dst, | 142 | void *dst, |
| 143 | int len, unsigned int sum, | 143 | int len, __wsum sum, |
| 144 | int *err_ptr) | 144 | int *err_ptr) |
| 145 | { | 145 | { |
| 146 | int missing; | 146 | int missing; |
