Re: [PATCH] usb: gadget: add claimed field in struct usb_ep

From: Robert Baldyga
Date: Mon Jun 23 2014 - 02:07:49 EST


On 06/19/2014 05:08 PM, Felipe Balbi wrote:
> On Mon, Jun 16, 2014 at 10:20:36AM +0200, Robert Baldyga wrote:
>> This field allows to mark ep as claimed in more clear way. Claiming
>> endpoint by setting driver_data to non-null value is leaky solution
>> and makes code unreadable.
>
> how come ? How can it be unreadable ? how can it be leaky ?
>

What if gadget will not assign any value to driver_data (just like
Gadget Zero do)? Endpoint will be seen as not used, and autoconfig will
return it more than one time. That's what I call leaky solution.

Information if endpoint is claimed or not is its internal state and
should not depend on assigning non-null value to driver_data field.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/