mbox series

[0/3] PCI: Use pci_dev_id() to simplify the code

Message ID 20230807134858.116051-1-wangxiongfeng2@huawei.com (mailing list archive)
Headers show
Series PCI: Use pci_dev_id() to simplify the code | expand

Message

Xiongfeng Wang Aug. 7, 2023, 1:48 p.m. UTC
PCI core API pci_dev_id() can be used to get the BDF number for a pci
device. We don't need to compose it mannually. Use pci_dev_id() to
simplify the code and make the code more readable.

Xiongfeng Wang (3):
  PCI: apple: use pci_dev_id() to simplify the code
  PCI/AER: Use pci_dev_id() to simplify the code
  PCI/IOV: Use pci_dev_id() to simplify the code

 drivers/pci/controller/pcie-apple.c | 4 ++--
 drivers/pci/iov.c                   | 3 +--
 drivers/pci/pcie/aer.c              | 4 ++--
 3 files changed, 5 insertions(+), 6 deletions(-)

Comments

Bjorn Helgaas Aug. 7, 2023, 9:16 p.m. UTC | #1
On Mon, Aug 07, 2023 at 09:48:55PM +0800, Xiongfeng Wang wrote:
> PCI core API pci_dev_id() can be used to get the BDF number for a pci
> device. We don't need to compose it mannually. Use pci_dev_id() to
> simplify the code and make the code more readable.
> 
> Xiongfeng Wang (3):
>   PCI: apple: use pci_dev_id() to simplify the code
>   PCI/AER: Use pci_dev_id() to simplify the code
>   PCI/IOV: Use pci_dev_id() to simplify the code
> 
>  drivers/pci/controller/pcie-apple.c | 4 ++--
>  drivers/pci/iov.c                   | 3 +--
>  drivers/pci/pcie/aer.c              | 4 ++--
>  3 files changed, 5 insertions(+), 6 deletions(-)

Applied to pci/misc for v6.6, thanks!

There are several similar cases outside drivers/pci/ that it would be
nice to clean up as well.

Bjorn
Xiongfeng Wang Aug. 8, 2023, 1:12 a.m. UTC | #2
On 2023/8/8 5:16, Bjorn Helgaas wrote:
> On Mon, Aug 07, 2023 at 09:48:55PM +0800, Xiongfeng Wang wrote:
>> PCI core API pci_dev_id() can be used to get the BDF number for a pci
>> device. We don't need to compose it mannually. Use pci_dev_id() to
>> simplify the code and make the code more readable.
>>
>> Xiongfeng Wang (3):
>>   PCI: apple: use pci_dev_id() to simplify the code
>>   PCI/AER: Use pci_dev_id() to simplify the code
>>   PCI/IOV: Use pci_dev_id() to simplify the code
>>
>>  drivers/pci/controller/pcie-apple.c | 4 ++--
>>  drivers/pci/iov.c                   | 3 +--
>>  drivers/pci/pcie/aer.c              | 4 ++--
>>  3 files changed, 5 insertions(+), 6 deletions(-)
> 
> Applied to pci/misc for v6.6, thanks!
> 
> There are several similar cases outside drivers/pci/ that it would be
> nice to clean up as well.

Sure, I will do that. Thanks !

Thanks,
Xiongfeng

> 
> Bjorn
> .
>