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

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

 



Felipe Balbi wrote:
> 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 ;-)

Whenever I send email outside of our organization, the "From" header
will be modified to an alias email address. I'm working with our IT to
see if we can do something about it. This may take some time. I hope
that this doesn't cause too much issue accepting my patches in the
meanwhile.

>
>> @@ -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?


It's because of open parenthesis descendant alignment style. I'll change
to not do that.

>> +{
>> +	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?
>

Same comment as above.

Thanks,
Thinh




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

  Powered by Linux