extra_size += (extp->MinorVersion < '4') ? 6 : 5; 
extra_size += 2; if (extp_size < sizeof(*extp) + extra_size) goto need_more; extra_size += extp->extra[extra_size-1]; 
read_pri_intelext(struct map_info *map, __u16 adr){	struct cfi_pri_intelext *extp;	unsigned int extp_size = sizeof(*extp); again:	extp = (struct cfi_pri_intelext *)cfi_read_pri(map, adr, extp_size, "Intel/Sharp");	if (!extp)		return NULL;	if (extp->MajorVersion != '1' ||	    (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {		printk(KERN_ERR "  Unknown Intel/Sharp Extended Query "		       "version %c.%c.\n",  extp->MajorVersion,		       extp->MinorVersion);		kfree(extp);		return NULL;	}	/* Do some byteswapping if necessary */	extp->FeatureSupport = le32_to_cpu(extp->FeatureSupport);	extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask);	extp->ProtRegAddr = le16_to_cpu(extp->ProtRegAddr);	if (extp->MajorVersion == '1' && extp->MinorVersion >= '3') {		unsigned int extra_size = 0;		int nb_parts, i;		/* Protection Register info */		extra_size += (extp->NumProtectionFields - 1) *			      sizeof(struct cfi_intelext_otpinfo);		/* Burst Read info */		extra_size += (extp->MinorVersion < '4') ? 6 : 5;		/* Number of hardware-partitions */		extra_size += 1;		if (extp_size < sizeof(*extp) + extra_size)			goto need_more;		nb_parts = extp->extra[extra_size - 1];		/* skip the sizeof(partregion) field in CFI 1.4 */		if (extp->MinorVersion >= '4')			extra_size += 2;		for (i = 0; i < nb_parts; i++) {			struct cfi_intelext_regioninfo *rinfo;			rinfo = (struct cfi_intelext_regioninfo *)&extp->extra[extra_size];			extra_size += sizeof(*rinfo);			if (extp_size < sizeof(*extp) + extra_size)				goto need_more;			rinfo->NumIdentPartitions=le16_to_cpu(rinfo->NumIdentPartitions);			extra_size += (rinfo->NumBlockTypes - 1)				      * sizeof(struct cfi_intelext_blockinfo);		}		if (extp->MinorVersion >= '4')			extra_size += sizeof(struct cfi_intelext_programming_regioninfo);		if (extp_size < sizeof(*extp) + extra_size) {			need_more:			extp_size = sizeof(*extp) + extra_size;			kfree(extp);			if (extp_size > 4096) {				printk(KERN_ERR					"%s: cfi_pri_intelext is too fat\n",					__FUNCTION__);				return NULL;			}			goto again;		}	}			return extp;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/6f6ed056d2d5de7af9f0c14cf5bc73707eeb0a88/cfi_cmdset_0001.c/clean/drivers/mtd/chips/cfi_cmdset_0001.c