[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52A23040.2000605@linux.intel.com>
Date: Fri, 06 Dec 2013 12:14:56 -0800
From: David Cohen <david.a.cohen@...ux.intel.com>
To: balbi@...com
CC: Michal Nazarewicz <mina86@...a86.com>, gregkh@...uxfoundation.org,
stern@...land.harvard.edu, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/5] usb: gadget: add quirk_ep_out_aligned_size field
to struct usb_gadget
On 12/06/2013 12:13 PM, Felipe Balbi wrote:
> On Tue, Nov 12, 2013 at 01:54:28PM +0100, Michal Nazarewicz wrote:
>> On Tue, Nov 12 2013, David Cohen wrote:
>>> On 11/11/2013 03:55 PM, Michal Nazarewicz wrote:
>>>> Come to think of it, perhaps even better helper would be:
>>>>
>>>> static inline size_t usb_ep_align_maybe(
>>>> struct usb_gadget *gadget, struct usb_ep *ep, size_t len) {
>>>> return gadget->quir_ep_out_aligned_size ?
>>>> round_up(len, (size_t)ep->desc->wMaxPacketSize) : len;
>>>> }
>>>
>>> The CPU time to check unsigned:1 and possibly jump is about the same as
>>> round_up() itself. For readability matters, we can round_up() directly.
>>
>> I was proposing to have this function and than not have functions check
>> for the flag. I.e. instead of
>>
>> if (gadget->quirk_ep_out_aligned_size)
>> len = usb_ep_align_maxpacketsize(ep, len);
>>
>> the code would just be:
>>
>> len = usb_ep_align_maybe(gadget, ep, len);
>
> that looks very good to me, do we have a version with that already ?
Nope. But as soon as soon as you finish the whole review, I can resend
new version with all changes at once.
Br, David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists