diff options
author | Jialin Zhang <zhangjialin11@huawei.com> | 2023-08-15 10:42:48 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-17 19:13:09 -0700 |
commit | a5e5b2cd47bc7ac853b3ae9d4af97d08caaf585d (patch) | |
tree | 879158e5679ca0d385c86ceca9511f5c17df825f /drivers/net/ethernet/amazon | |
parent | b2f8323364abf1b6fcd828851ea8be2f757c052a (diff) | |
download | lwn-a5e5b2cd47bc7ac853b3ae9d4af97d08caaf585d.tar.gz lwn-a5e5b2cd47bc7ac853b3ae9d4af97d08caaf585d.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/amazon')
-rw-r--r-- | drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index d19593fae226..ad32ca81f7ef 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3267,7 +3267,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev, struct pci_dev *pd host_info = ena_dev->host_attr.host_info; - host_info->bdf = (pdev->bus->number << 8) | pdev->devfn; + host_info->bdf = pci_dev_id(pdev); host_info->os_type = ENA_ADMIN_OS_LINUX; host_info->kernel_ver = LINUX_VERSION_CODE; strscpy(host_info->kernel_ver_str, utsname()->version, |