All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH v3 1/4] usb: dwc3: gadget: Refactor preparing TRBs
Date: Mon, 07 Sep 2020 09:24:53 +0300	[thread overview]
Message-ID: <87lfhm14ui.fsf@kernel.org> (raw)
In-Reply-To: <66fa061307b6f4eff00fb279ae5130c3bd8720f7.1599098161.git.thinhn@synopsys.com>

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

Thinh Nguyen <Thinh.Nguyen@synopsys.com> 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@synopsys.com>

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

  reply	other threads:[~2020-09-07  6:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03  2:06 [PATCH v3 0/4] usb: dwc3: gadget: Fix TRB preparation Thinh Nguyen
2020-09-03  2:06 ` [PATCH v3 1/4] usb: dwc3: gadget: Refactor preparing TRBs Thinh Nguyen
2020-09-07  6:24   ` Felipe Balbi [this message]
2020-09-08 18:17     ` Thinh Nguyen
2020-09-03  2:06 ` [PATCH v3 2/4] usb: dwc3: gadget: Account for extra TRB Thinh Nguyen
2020-09-07  6:28   ` Felipe Balbi
2020-09-08 18:21     ` Thinh Nguyen
2020-09-03  2:06 ` [PATCH v3 3/4] usb: dwc3: gadget: Rename misleading function names Thinh Nguyen
2020-09-03  2:06 ` [PATCH v3 4/4] usb: dwc3: ep0: Skip ZLP setup for OUT Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfhm14ui.fsf@kernel.org \
    --to=balbi@kernel.org \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.