Hello. Ming Lei wrote:
I don't understand why we have to check this twice when only once would suffice.
This check can handle both zero and non-zero request, so it is needed.
It's needed above all the other checks, that's all. We don't need to check it twice.
The 1st check is if ((request->zero && request->length && (request->length % musb_ep->packet_sz == 0) && (request->actual == request->length) || ... ) { ... } The 2nd is if (request->actual == request->length) { musb_g_giveback(musb_ep, request, 0); ...... } The 1st check only can handle request with zlp,
That's only in your patch. The original code was correct, except 'is_dma' part.
We have discussed the patch for some time already, why do you say original code again?
I was discussing the approach, not your patch.
For the patch, it is more clear than original code in logic: - handle zlp or short packet first if one of two conditions is true - complete the request if data transfer is over
Both these should be done when (request->actual == request->length), that's my point.
If you have not any objections for this patch instead of original code, I will submit to Felipe and let him decide.
I have objection to duplicate (request->actual == request->length) check. I keep telling you that from the very start...
WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html