On Wed, May 2, 2012 at 7:53 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Wed, 2 May 2012, Felipe Balbi wrote: > >> On Wed, May 02, 2012 at 04:11:04PM +0530, Pratyush Anand wrote: >> > On 5/2/2012 3:57 PM, Felipe Balbi wrote: >> > >>>if (transfer_size % dep->endpoint.maxpacket) >> > >>>> > transfer_size += transfer_size % dep->endpoint.maxpacket; >> > >>> >> > >>> will this not make transfer_size *= 2? >> > >>> Probably it is not intended. >> > >>> We want to keep transfer_size to maxpacket in case of direction=0; >> > >no no, we want to make transfer_size aligned to wMaxPacketSize, so if >> > >req->request.length == 1025, we want transfer_size = 2048 >> > > >> > >> > Correct, So I was wondering if above code does that. >> > I think you wanted: >> > >> > if (transfer_size % dep->endpoint.maxpacket) >> > transfer_size += (dep->endpoint.maxpacket - (transfer_size % >> > dep->endpoint.maxpacket)); >> >> that's correct ;-) my mistake > > Doesn't the roundup() routine do what you want? correct. Will use this function. > > Alan Stern > > -- > 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 -- 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