Skip to content

Commit a5e5b2c

Browse files
Jialin Zhangkuba-moo
authored andcommitted
net: ena: Use pci_dev_id() to simplify the code
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 manually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Shay Agroskin <shayagr@amazon.com> Link: https://lore.kernel.org/r/20230815024248.3519068-1-zhangjialin11@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b2f8323 commit a5e5b2c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3267,7 +3267,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev, struct pci_dev *pd
32673267

32683268
host_info = ena_dev->host_attr.host_info;
32693269

3270-
host_info->bdf = (pdev->bus->number << 8) | pdev->devfn;
3270+
host_info->bdf = pci_dev_id(pdev);
32713271
host_info->os_type = ENA_ADMIN_OS_LINUX;
32723272
host_info->kernel_ver = LINUX_VERSION_CODE;
32733273
strscpy(host_info->kernel_ver_str, utsname()->version,

0 commit comments

Comments
 (0)