lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNuiF7D/fDRhPVoi@vergenet.net>
Date: Tue, 15 Aug 2023 18:04:39 +0200
From: Simon Horman <horms@...nel.org>
To: Jialin Zhang <zhangjialin11@...wei.com>
Cc: shayagr@...zon.com, 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

On Tue, Aug 15, 2023 at 10:42:48AM +0800, Jialin Zhang 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

nit: mannually -> manually

> 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,
> -- 
> 2.25.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ