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.
Unified · Split
| @@ -3267,7 +3267,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev, struct pci_dev *pd · 3266 unmodified lines | ||
| 3267 | 3267 | |
| 3268 | 3268 | host_info = ena_dev->host_attr.host_info; |
| 3269 | 3269 | |
| 3270 | − host_info->bdf = (pdev->bus->number << 8) | pdev->devfn; | |
| 3270 | + host_info->bdf = pci_dev_id(pdev); | |
| 3271 | 3271 | host_info->os_type = ENA_ADMIN_OS_LINUX; |
| 3272 | 3272 | host_info->kernel_ver = LINUX_VERSION_CODE; |
| 3273 | 3273 | strscpy(host_info->kernel_ver_str, utsname()->version, |