In article <[email protected]>, Nick Hudson <[email protected]> wrote: >-=-=-=-=-=- > >+ if (xfer->status == USBD_NORMAL_COMPLETION) { >+ int rd = usbd_xfer_isread(xfer); >+ >+ /* >+ * control transfers with no data phase don't touch dmabuf, but >+ * everything else does. >+ */ >+ if (!(xfertype == UE_CONTROL && >+ UGETW(xfer->request.wLength) == 0)) { >+ usb_syncmem(&xfer->dmabuf, 0, xfer->actlen, >+ rd ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); >+ } >+ } >+
Why initialize rd so early, before it is needed? christos
