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>
This commit is contained in:
parent
bb1459cb84
commit
5d344c5eb4
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user