Re: [PATCH] Add usb_setup_{control, bulk, int}_urb helpers

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, 25 Jun 2007, Greg KH wrote:

> You mean something like the following, but also for bulk and int?  I
> like it, it reduces the number of allocations and frees we have to do as
> the transfer buffer will get freed automatically with the urb, when it
> is.
> 
> What do people think?

> +	urb = kzalloc(sizeof(*urb) + size, mem_flags);
> +	if (!urb)
> +		return NULL;
> +	buffer = ((unsigned char *)(urb) + size);

This is no good.  The buffer has to be located in its own cache line; 
it can't be combined with another data structure like the URB.  They 
must be allocated separately.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.