lkml.org 
[lkml]   [2014]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/3] usb: gadget: Refactor request completion
On Wed, 27 Aug 2014, Michal Sojka wrote:

> +/**
> + * usb_gadget_giveback_request - give the request back to the gadget layer
> + * Context: in_interrupt()
> + *
> + * This is called by device controller drivers in order to return the
> + * completed request back to the gadget layer.
> + */
> +void usb_gadget_giveback_request(struct usb_ep *ep,
> + struct usb_request *req)
> +{
> + BUG_ON(req->complete == NULL);
> + req->complete(ep, req);
> +}

I guess it doesn't hurt to have the BUG_ON, but it doesn't help either.
Think about what would happen if req->complete was NULL and the BUG_ON
wasn't present.

Alan Stern



\
 
 \ /
  Last update: 2014-08-27 23:21    [W:0.076 / U:2.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site