diff options
author | Zheng Zengkai <zhengzengkai@huawei.com> | 2023-08-11 19:13:10 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-08-21 17:13:56 -0400 |
commit | 5d344c5eb4158808ce82cacf8d5dae8339da84f2 (patch) | |
tree | 91c8d69199a4d2674b11733f9898afa0dabebece /drivers/scsi/pmcraid.c | |
parent | bb1459cb84da009bb4c5faed4a2647ce3810bdca (diff) | |
download | linux-stable-5d344c5eb4158808ce82cacf8d5dae8339da84f2.tar.gz linux-stable-5d344c5eb4158808ce82cacf8d5dae8339da84f2.tar.bz2 linux-stable-5d344c5eb4158808ce82cacf8d5dae8339da84f2.zip |
scsi: pmcraid: 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: Zheng Zengkai <zhengzengkai@huawei.com>
Link: https://lore.kernel.org/r/20230811111310.32364-1-zhengzengkai@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pmcraid.c')
-rw-r--r-- | drivers/scsi/pmcraid.c | 3 |
1 files changed, 1 insertions, 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, |