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

Re: [PATCH v3 02/11] driver/pci: Get next capability without passing caps


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Wed, 23 Apr 2025 03:13:16 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ed1HVcjbl+EBoNKSdFW/uFiWpW7xV/VA8EAMeFrwaz8=; b=SBTyB/d6EFj3KK85IldRmSUNQ+PXK/jajkQdoDhoHnzf7E6SlVIecsw1TCEr5BmT5RmCGBdCuBg5eGsyp1sN4a+C3BkiT4of7AftZpA24NieVtoXRDkG0K7J0jfB6JnnxcW18uNdEH6E44zQhfRp5HIKMtaAidbmJ9C+fbu4xyrOa6T/JZAZ3aVu4HmYssTod4aaYYSJDJizyhcmCLdMuEp3FHvJeV70ZdgRLXgP7rl0pzNJ3EMySA2oTyCeWmwShGYM/t2jJ+DZTCzAVxNyo0dN9r+9W2jl3PIol2p6QezuZLtWNT7PhWlFktLliLUZWmouXZznV9v+73EqW6eWNQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Qxe/ajEW+lQHF5qeajhhs4QCRXJ5BcTa8o/ZoC4/fFDj8ptdDvSqCM3UhKle7TpcfjK0WUVSaHpWIZ2+Qev7NmQYEJCZghlqaz+fV+qYZFVWJNsJsIAjwTJM0jE4e4anDLetk4OeIQm2SxUFMOygGHKrfBBbhI2w9jlllymyDZmGJPeBf4FPnXITNgVZo1LwvMbBV1LN1E0FPPZFogy8ZKkNlGxkRWh7Mmd4iLqJXC0+BCXoAode1nepIxyFrvgIEbs1bX7gownPksbv0GtIrcGafGtOtF7S+NnR4toLTxAk7Zx2F307miS5l07hszDsaJBQSSja37NbbHK3JsiKCQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Wed, 23 Apr 2025 03:13:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbsoVXQBbkP7I+H0O+xO6/Zu2wRbOv2fGAgAE+FAA=
  • Thread-topic: [PATCH v3 02/11] driver/pci: Get next capability without passing caps

On 2025/4/22 23:59, Jan Beulich wrote:
> On 21.04.2025 08:18, Jiqian Chen wrote:
>> Modify function pci_find_next_cap_ttl to support returning position
>> of next capability when size "n" is zero.
>>
>> That can help caller to get next capability offset if caller just
>> has a information of current capability offset.
>>
>> That will be used in a follow-on change.
>>
>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
> 
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Thank you.

> albeit ...
> 
>> --- a/xen/drivers/pci/pci.c
>> +++ b/xen/drivers/pci/pci.c
>> @@ -55,6 +55,9 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, 
>> unsigned int pos,
>>  
>>          if ( id == 0xff )
>>              break;
>> +        if ( n == 0 )
>> +            return pos;
>> +        ASSERT(caps);
>>          for ( i = 0; i < n; i++ )
>>          {
>>              if ( id == caps[i] )
> 
> ... blank lines around you insertion might have been nice. I may take the
> liberty of adding them while committing.
That's fine, please add.

> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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