if (sg_mapped > MAX_INDIRECT_BUFS) { 
if (sg_mapped > SG_ALL) { 
static int map_sg_data(struct scsi_cmnd *cmd,		       struct srp_cmd *srp_cmd, struct device *dev){	int i, sg_mapped;	u64 total_length = 0;	struct scatterlist *sg = cmd->request_buffer;	struct memory_descriptor *data =	    (struct memory_descriptor *)srp_cmd->additional_data;	struct indirect_descriptor *indirect =	    (struct indirect_descriptor *)data;	sg_mapped = dma_map_sg(dev, sg, cmd->use_sg, DMA_BIDIRECTIONAL);	if (sg_mapped == 0)		return 0;	set_srp_direction(cmd, srp_cmd, sg_mapped);	/* special case; we can use a single direct descriptor */	if (sg_mapped == 1) {		data->virtual_address = sg_dma_address(&sg[0]);		data->length = sg_dma_len(&sg[0]);		data->memory_handle = 0;		return 1;	}	if (sg_mapped > MAX_INDIRECT_BUFS) {		printk(KERN_ERR		       "ibmvscsi: More than %d mapped sg entries, got %d\n",		       MAX_INDIRECT_BUFS, sg_mapped);		return 0;	}	indirect->head.virtual_address = 0;	indirect->head.length = sg_mapped * sizeof(indirect->list[0]);	indirect->head.memory_handle = 0;	for (i = 0; i < sg_mapped; ++i) {		struct memory_descriptor *descr = &indirect->list[i];		struct scatterlist *sg_entry = &sg[i];		descr->virtual_address = sg_dma_address(sg_entry);		descr->length = sg_dma_len(sg_entry);		descr->memory_handle = 0;		total_length += sg_dma_len(sg_entry);	}	indirect->total_length = total_length;	return 1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4dddbc26c3895ecdab1f4b16435685b47f96f599/ibmvscsi.c/buggy/drivers/scsi/ibmvscsi/ibmvscsi.c