Lines Matching +full:carry +full:- +full:less
1 // SPDX-License-Identifier: GPL-2.0
6 * in an architecture-specific manner due to speed..
10 * Rick Gorton <rick.gorton@alpha-processor.com>
44 * computes the checksum of the TCP/UDP pseudo-header
45 * returns a 16-bit checksum, already complemented.
64 /* Fold down to 32-bits so we don't lose in the typedef-less in csum_tcpudp_nofold()
75 * Do a 64-bit checksum on an arbitrary memory area..
79 * ways to do the carry, but this is reasonable.
91 len--; in do_csum()
94 count = len >> 1; /* nr of 16-bit words.. */ in do_csum()
98 count--; in do_csum()
99 len -= 2; in do_csum()
102 count >>= 1; /* nr of 32-bit words.. */ in do_csum()
106 count--; in do_csum()
107 len -= 4; in do_csum()
110 count >>= 1; /* nr of 64-bit words.. */ in do_csum()
112 unsigned long carry = 0; in do_csum() local
115 count--; in do_csum()
117 result += carry; in do_csum()
119 carry = (w > result); in do_csum()
121 result += carry; in do_csum()
155 * and adds in "sum" (32-bit)
157 * returns a 32-bit number suitable for feeding into itself
163 * it's best to have buff aligned on a 32-bit boundary
169 /* add in old sum, and carry.. */ in csum_partial()
171 /* 32+c bits -> 32 bits */ in csum_partial()
179 * this routine is used for miscellaneous IP-like checksums, mainly