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>
42 * computes the checksum of the TCP/UDP pseudo-header
43 * returns a 16-bit checksum, already complemented.
62 /* Fold down to 32-bits so we don't lose in the typedef-less in csum_tcpudp_nofold()
73 * Do a 64-bit checksum on an arbitrary memory area..
77 * ways to do the carry, but this is reasonable.
89 len--; in do_csum()
92 count = len >> 1; /* nr of 16-bit words.. */ in do_csum()
96 count--; in do_csum()
97 len -= 2; in do_csum()
100 count >>= 1; /* nr of 32-bit words.. */ in do_csum()
104 count--; in do_csum()
105 len -= 4; in do_csum()
108 count >>= 1; /* nr of 64-bit words.. */ in do_csum()
110 unsigned long carry = 0; in do_csum() local
113 count--; in do_csum()
115 result += carry; in do_csum()
117 carry = (w > result); in do_csum()
119 result += carry; in do_csum()
153 * and adds in "sum" (32-bit)
155 * returns a 32-bit number suitable for feeding into itself
161 * it's best to have buff aligned on a 32-bit boundary
167 /* add in old sum, and carry.. */ in csum_partial()
169 /* 32+c bits -> 32 bits */ in csum_partial()
177 * this routine is used for miscellaneous IP-like checksums, mainly