[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <pj41zl1qg4wsp9.fsf@u95c7fd9b18a35b.ant.amazon.com>
Date: Tue, 15 Aug 2023 11:31:19 +0300
From: Shay Agroskin <shayagr@...zon.com>
To: Jialin Zhang <zhangjialin11@...wei.com>
CC: <akiyano@...zon.com>, <darinzon@...zon.com>, <ndagan@...zon.com>,
<saeedb@...zon.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
<kuba@...nel.org>, <pabeni@...hat.com>, <michal.kubiak@...el.com>,
<yuancan@...wei.com>, <netdev@...r.kernel.org>, <liwei391@...wei.com>,
<wangxiongfeng2@...wei.com>
Subject: Re: [PATCH] net: ena: Use pci_dev_id() to simplify the code
Jialin Zhang <zhangjialin11@...wei.com> writes:
> 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 a little bit.
>
> Signed-off-by: Jialin Zhang <zhangjialin11@...wei.com>
> ---
> drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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,
Same as Leon's response. Otherwise lgtm
Reviewed-by: Shay Agroskin <shayagr@...zon.com>
Powered by blists - more mailing lists