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

Re: [PATCH v3 10/10] driver/char: add RX support to the XHCI driver


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 5 Aug 2022 14:51:56 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T4YCCyZq4pRPcp5PXZinSK0SdcCmt321BWtKAzULGHI=; b=fpXlAxz5Rq9vRxmi15Oyo+L067b41f0OUebGsngG/wcg1CiW3Rn3U94GzqEuF3NfP6/wUS9iKbnW620f//jT3Or1ZZ/V9kRs+9Fr6lW+a2z7iNYnDY1rtab1Rgk7f7mEJQWbHw7z4p1+YOT5aM6zX8uLwtBRpcUkNjMqJ8u4y0cMmMmCSyylcayBQu1V23CrPM+azg+K/OgoFBmfq7/dJomNCiDeTeiShWprUTkU13zZq6e+kc7cQtKh7dDeDLPAQG5QDJu3dAVSJ0tM/OykVRj56YIfNSDqLnxcugi30etV4QPJLq3AVuopOWmFhW/jQtKEghrIZon9g1Z/IzHLVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bveTuXAPKuT0RDlEhigAVC7d+ONab5F8aykkTZ+xM1480y1wA9TLvllMU4WMSFk9gGjGIYLVMmVzmHSbWDtq684CpeE4qF6kGrf5n6jCwjcuFyFa2mq/DAwpGlSu4vdo/DJfisj3fVagR5+gKb7sT9wqBNjgLAX3bONc92oNOIUASRTIZrgaE1CwPFElyGaiVdLcLBA/dLqAYG7d8rFlsK0qaCtn6VWieV0rNm29lhR1OqCs1+wVOAAYKXU9zyVxYphucD6m2XLIO6L2lGAlQesXKhzW2Mr4rBvC5BneS0roJoxnz71hJrIiVYe/wghwIAtZ8La9HkR7vWN96Wzj2g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 05 Aug 2022 12:52:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.08.2022 14:47, Marek Marczykowski-Górecki wrote:
> On Fri, Aug 05, 2022 at 02:38:26PM +0200, Jan Beulich wrote:
>> On 05.08.2022 11:58, Marek Marczykowski-Górecki wrote:
>>> On Fri, Aug 05, 2022 at 10:38:13AM +0200, Jan Beulich wrote:
>>>> On 26.07.2022 05:23, Marek Marczykowski-Górecki wrote:
>>>>> @@ -454,6 +466,12 @@ static uint32_t xhci_trb_tfre_cc(const struct 
>>>>> xhci_trb *trb)
>>>>>      return trb->status >> 24;
>>>>>  }
>>>>>  
>>>>> +/* Amount of data _not_ transferred */
>>>>> +static uint32_t xhci_trb_tfre_len(const struct xhci_trb *trb)
>>>>> +{
>>>>> +    return trb->status & 0x1FFFF;
>>>>> +}
>>>>
>>>> Same as xhci_trb_norm_len()?
>>>
>>> Yes, I was considering to use that, but technically those are different
>>> packets, only incidentally using the same bits.
>>
>> I see. That's the problem with using literal numbers rather than #define-s.
>> But for a driver like this I didn't want to be overly picky, and hence
>> would have wanted to let you get away without introducing many more.
> 
> That's kind of the purpose of those helper functions - to extract
> specific fields according to the xhci interface, one per function. An
> alternative could be #define _instead of_ those functions, but I think
> that would be worse.  What I mean, is the function name serves as
> description of that those constants are about.

Right - as said, fair enough for a driver like this.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.