Re: [PATCH v3 1/4] usb: dwc3: gadget: Refactor preparing TRBs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx> writes:

> There are a lot of common codes for preparing SG and linear TRBs. Let's
> refactor them for easier read. No functional change here.
>
> Signed-off-by: Thinh Nguyen <thinhn@xxxxxxxxxxxx>

email here doesn't match author's ;-)

> @@ -1091,6 +1091,65 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
>  			stream_id, short_not_ok, no_interrupt, is_last);
>  }
>  
> +/**
> + * dwc3_prepare_last_sg - prepare TRBs for the last SG entry
> + * @dep: The endpoint that the request belongs to
> + * @req: The request to prepare
> + * @entry_length: The last SG entry size
> + * @node: Indicates whether this is not the first entry (for isoc only)
> + */
> +static void dwc3_prepare_last_sg(struct dwc3_ep *dep,
> +				 struct dwc3_request *req,
> +				 unsigned int entry_length,
> +				 unsigned int node)

I think some of these can be combined into a single line. Also, why so
far to the right on the line breaks? Could you keep the existing style?

> +{
> +	unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
> +	unsigned int rem = req->request.length % maxp;
> +	unsigned int num_extra_trbs = 0;
> +	unsigned int i;
> +	bool do_zlp = false;
> +
> +	if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
> +	    req->request.zero && req->request.length && !rem) {

spaces for indentation?

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux