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: Zheng Zengkai <zhengzengkai@xxxxxxxxxx> --- drivers/scsi/pmcraid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 9415a4819470..50dc30051f22 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3584,8 +3584,7 @@ static ssize_t pmcraid_show_adapter_id( struct Scsi_Host *shost = class_to_shost(dev); struct pmcraid_instance *pinstance = (struct pmcraid_instance *)shost->hostdata; - u32 adapter_id = (pinstance->pdev->bus->number << 8) | - pinstance->pdev->devfn; + u32 adapter_id = pci_dev_id(pinstance->pdev); u32 aen_group = pmcraid_event_family.id; return snprintf(buf, PAGE_SIZE, -- 2.20.1