/* Maintained at www.Open-FCoE.org Frame allocation. Check the CRC in a frame.  */
u32 fc_frame_crc_check(struct fc_frame *fp)
/* Maintained at www.Open-FCoE.org Frame allocation. Check the CRC in a frame.  */
u32 fc_frame_crc_check(struct fc_frame *fp)
{
	u32 crc;
	u32 error;
	const u8 *bp;
	unsigned int len;
	WARN_ON(!fc_frame_is_linear(fp));
	fr_flags(fp) &= ~FCPHF_CRC_UNCHECKED;
	len = (fr_len(fp) + 3) & ~3;
	bp = (const u8 *) fr_hdr(fp);
	crc = ~crc32(~0, bp, len);
	error = crc ^ fr_crc(fp);
	return error;
}