Lines Matching refs:sum
1343 sum += t;
1345 - /* Fold 32-bit sum to 16 bits */
1346 - while ((sum >> 16) != 0)
1347 - sum = (sum & 0xffff) + (sum >> 16);
1348 + /* Fold 32-bit sum to 16 bits
1350 + sum = FOLD_U32T(sum);
1351 + sum = FOLD_U32T(sum);
1355 - sum = ((sum & 0xff) << 8) | ((sum & 0xff00) >> 8);
1357 + sum = SWAP_BYTES_IN_WORD(sum);
1360 return sum;
1365 tmp = sum + *pl++; /* ping */
1366 - if (tmp < sum)
1367 + if (tmp < sum) {
1371 sum = tmp + *pl++; /* pong */
1372 - if (sum < tmp)
1373 + if (sum < tmp) {
1374 sum++; /* add back carry */
1381 - sum = (sum >> 16) + (sum & 0xffff);
1382 + sum = FOLD_U32T(sum);
1395 sum += t; /* add end bytes */
1397 - while ((sum >> 16) != 0) /* combine halves */
1398 - sum = (sum >> 16) + (sum & 0xffff);
1399 + /* Fold 32-bit sum to 16 bits
1401 + sum = FOLD_U32T(sum);
1402 + sum = FOLD_U32T(sum);
1405 - sum = ((sum & 0xff) << 8) | ((sum & 0xff00) >> 8);
1407 + sum = SWAP_BYTES_IN_WORD(sum);
1410 return sum;
1443 + /* Fold 32-bit sum to 16 bits
1480 + /* Fold 32-bit sum to 16 bits