Skip to content

Commit 5d344c5

Browse files
Zhengzengkaimartinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent bb1459c commit 5d344c5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/scsi/pmcraid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3584,8 +3584,7 @@ static ssize_t pmcraid_show_adapter_id(
35843584
struct Scsi_Host *shost = class_to_shost(dev);
35853585
struct pmcraid_instance *pinstance =
35863586
(struct pmcraid_instance *)shost->hostdata;
3587-
u32 adapter_id = (pinstance->pdev->bus->number << 8) |
3588-
pinstance->pdev->devfn;
3587+
u32 adapter_id = pci_dev_id(pinstance->pdev);
35893588
u32 aen_group = pmcraid_event_family.id;
35903589

35913590
return snprintf(buf, PAGE_SIZE,

0 commit comments

Comments
 (0)