On Mon, 18 Nov 2002, Oliver Neukum wrote:

> OK, here we go.
> 
>       case CPAD_CGID:
> 
> - Race condition. You must drop the lock only after the last put_user

fixed.
> 
>   /* see if we are already in the middle of a write */
>   if (dev->write_urb->status == -EINPROGRESS) {
>     dbg (__FUNCTION__ " - already writing");
>     goto exit;
>   }
> 
> - Bad. Wait for completion in that case, or, if you are opened non blocking,
>   return the right error code

ok, need to look through more example code to work out wait for
completion, but have put in better error codes.

>     for (i=bytes_written,wcount=2;i>1 && wcount<CPAD_BUFMAX;)
>       ((char *) dev->write_urb->transfer_buffer)[wcount++] = tmpbuf[--i];
> 
> - You might better copy into the buffer in first place instead of another copy

agreed, however at this step bytes from 2 onward are reversed so that the
user API looks like the LCD controller datasheet says and the bits/bytes
of the bitmap lies increment correctly as it goes out to the display
(don't know why these bytes are reversed, didn't build it :-)

>   unsigned char mdata[8];                       /* cpad mouse input buffer */
> 
> - You must not do that. You violate DMA requirements on some architectures.
>   Allocate the buffer sperately with kmalloc.

thank you, fixed.

cheers,

rob.




-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to