for (i = 0; i < DC395x_MAX_SRB_CNT; i++) { 
for (i = 0; i < DC395x_MAX_SRB_CNT; i++) 
static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb){	const unsigned mem_needed = (DC395x_MAX_SRB_CNT+1)	                            *SEGMENTX_LEN;	int pages = (mem_needed+(PAGE_SIZE-1))/PAGE_SIZE;	const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN;	int srb_idx = 0;	unsigned i = 0;	struct SGentry *ptr;	void **virt_array;	for (i = 0; i < DC395x_MAX_SRB_CNT; i++) {		acb->srb_array[i].segment_x = NULL;		acb->srb_array[i].virt_map = NULL;	}	dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages);	while (pages--) {		ptr = (struct SGentry *)kmalloc(PAGE_SIZE, GFP_KERNEL);		if (!ptr) {			adapter_sg_tables_free(acb);			return 1;		}		dprintkdbg(DBG_1, "Allocate %li bytes at %p for SG segments %i\n",			PAGE_SIZE, ptr, srb_idx);		i = 0;		while (i < srbs_per_page && srb_idx < DC395x_MAX_SRB_CNT)			acb->srb_array[srb_idx++].segment_x =			    ptr + (i++ * DC395x_MAX_SG_LISTENTRY);	}	if (i < srbs_per_page)		acb->srb.segment_x =		    ptr + (i * DC395x_MAX_SG_LISTENTRY);	else		dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n");	virt_array = vmalloc((DC395x_MAX_SRB_CNT + 1) * DC395x_MAX_SG_LISTENTRY * sizeof(void*));	if (!virt_array) {		adapter_sg_tables_free(acb);		return 1;	}	for (i = 0; i < DC395x_MAX_SRB_CNT + 1; i++) {		acb->srb_array[i].virt_map = virt_array;		virt_array += DC395x_MAX_SG_LISTENTRY;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b4b08e581fac8e0ba9ae348bdc13246c9798c99e/dc395x.c/buggy/drivers/scsi/dc395x.c