 /* No non-LBA info .. so valid! */ if (id->cyls == 0) return 1; 
static int lba_capacity_is_ok (struct hd_driveid *id){	unsigned long lba_sects, chs_sects, head, tail;	/*	 * The ATA spec tells large drives to return	 * C/H/S = 16383/16/63 independent of their size.	 * Some drives can be jumpered to use 15 heads instead of 16.	 * Some drives can be jumpered to use 4092 cyls instead of 16383.	 */	if ((id->cyls == 16383	     || (id->cyls == 4092 && id->cur_cyls == 16383)) &&	    id->sectors == 63 &&	    (id->heads == 15 || id->heads == 16) &&	    (id->lba_capacity >= 16383*63*id->heads))		return 1;	lba_sects   = id->lba_capacity;	chs_sects   = id->cyls * id->heads * id->sectors;	/* perform a rough sanity check on lba_sects:  within 10% is OK */	if ((lba_sects - chs_sects) < chs_sects/10)		return 1;	/* some drives have the word order reversed */	head = ((lba_sects >> 16) & 0xffff);	tail = (lba_sects & 0xffff);	lba_sects = (head | (tail << 16));	if ((lba_sects - chs_sects) < chs_sects/10) {		id->lba_capacity = lba_sects;		return 1;	/* lba_capacity is (now) good */	}	return 0;	/* lba_capacity value may be bad */}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6efd936046b123303ace4330fd2f26195ad7b1c4/ide-disk.c/buggy/drivers/ide/ide-disk.c