static int tpm_atml_recv(struct tpm_chip *chip, u8 * buf, size_t count) 
static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count) 
static int tpm_atml_recv(struct tpm_chip *chip, u8 * buf, size_t count){	u8 status, *hdr = buf;	u32 size;	int i;	__be32 *native_size;	/* start reading header */	if (count < 6)		return -EIO;	for (i = 0; i < 6; i++) {		status = inb(chip->vendor->base + 1);		if ((status & ATML_STATUS_DATA_AVAIL) == 0) {			dev_err(chip->dev,				"error reading header\n");			return -EIO;		}		*buf++ = inb(chip->vendor->base);	}	/* size of the data received */	native_size = (__force __be32 *) (hdr + 2);	size = be32_to_cpu(*native_size);	if (count < size) {		dev_err(chip->dev,			"Recv size(%d) less than available space\n", size);		for (; i < size; i++) {	/* clear the waiting data anyway */			status = inb(chip->vendor->base + 1);			if ((status & ATML_STATUS_DATA_AVAIL) == 0) {				dev_err(chip->dev,					"error reading data\n");				return -EIO;			}		}		return -EIO;	}	/* read all the data available */	for (; i < size; i++) {		status = inb(chip->vendor->base + 1);		if ((status & ATML_STATUS_DATA_AVAIL) == 0) {			dev_err(chip->dev,				"error reading data\n");			return -EIO;		}		*buf++ = inb(chip->vendor->base);	}	/* make sure data available is gone */	status = inb(chip->vendor->base + 1);	if (status & ATML_STATUS_DATA_AVAIL) {		dev_err(chip->dev, "data available is stuck\n");		return -EIO;	}	return size;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b888c87b7498557d1dbb9de3d4b8402b1bb89193/tpm_atmel.c/buggy/drivers/char/tpm/tpm_atmel.c