src/dpdk/drivers/crypto/dpaa_sec/dpaa_sec.h
static inline uint16_t
calc_chksum(void *buffer, int len)
{
	uint16_t *buf = (uint16_t *)buffer;
	uint32_t sum = 0;
	uint16_t result;

	for (sum = 0; len > 1; len -= 2)
		sum += *buf++;

	if (len == 1)
		sum += *(unsigned char *)buf;

	sum = (sum >> 16) + (sum & 0xFFFF);
	sum += (sum >> 16);
	result = ~sum;

	return  result;
}
/**
 * Checksum
 *
 * @param buffer calculate chksum for buffer
 * @param len    buffer length
 *
 * @return checksum value in host cpu order
 */
Checksum
@param buffer calculate chksum for buffer
@param len    buffer length

@return checksum value in host cpu order
Checksum @param buffer calculate chksum for buffer @param len buffer length @return checksum value in host cpu order
static inline uint16_t
calc_chksum(void *buffer, int len)
{
	uint16_t *buf = (uint16_t *)buffer;
	uint32_t sum = 0;
	uint16_t result;
	for (sum = 0; len > 1; len -= 2)
		sum += *buf++;
	if (len == 1)
		sum += *(unsigned char *)buf;
	sum = (sum >> 16) + (sum & 0xFFFF);
	sum += (sum >> 16);
	result = ~sum;
	return  result;
}
static inline uint16_t calc_chksum ( void * buffer , int len ) { uint16_t * buf = ( uint16_t * ) buffer ; uint32_t sum = 0 ; uint16_t result ; for ( sum = 0 ; len > 1 ; len -= 2 ) sum += * buf ++ ; if ( len == 1 ) sum += * ( unsigned char * ) buf ; sum = ( sum >> 16 ) + ( sum & 0xFFFF ) ; sum += ( sum >> 16 ) ; result = ~ sum ; return result ; }
Checksum
 @param buffer calculate chksum for buffer
 @param len    buffer length
Checksum @param buffer calculate chksum for buffer @param len buffer length