Skip to content

Commit

Permalink
scsi: pmcraid: Use pci_dev_id() to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zheng Zengkai authored and Martin K. Petersen committed Aug 21, 2023
1 parent bb1459c commit 5d344c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/pmcraid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5d344c5

Please sign in to comment.