/* @buf: IP header @len: length of header in bytes  */
static unsigned int efi_ip_checksum(const void *buf, size_t len)
/* @buf: IP header @len: length of header in bytes  */
static unsigned int efi_ip_checksum(const void *buf, size_t len)
{
	size_t i;
	u32 sum = 0;
	const u16 *pos = buf;
	for (i = 0; i < len; i += 2)
		sum += *pos++;
	sum = (sum >> 16) + (sum & 0xffff);
	sum += sum >> 16;
	sum = ~sum & 0xffff;
	return sum;
}