sg [i].page = virt_to_page (buf); sg [i].offset = offset_in_page (buf); sg [i].length = size; 
sg_init_one(&sg[i], buf, size); 
alloc_sglist (int nents, int max, int vary){	struct scatterlist	*sg;	unsigned		i;	unsigned		size = max;	sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL);	if (!sg)		return NULL;	memset (sg, 0, nents * sizeof *sg);	for (i = 0; i < nents; i++) {		char		*buf;		buf = kmalloc (size, SLAB_KERNEL);		if (!buf) {			free_sglist (sg, i);			return NULL;		}		memset (buf, 0, size);		/* kmalloc pages are always physically contiguous! */		sg [i].page = virt_to_page (buf);		sg [i].offset = offset_in_page (buf);		sg [i].length = size;		if (vary) {			size += vary;			size %= max;			if (size == 0)				size = (vary < max) ? vary : max;		}	}	return sg;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/378f058cc49bcda7fa63d3cd86d2f9a0a5188b1c/usbtest.c/clean/drivers/usb/misc/usbtest.c