Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zheng Zengkai and committed by
Martin K. Petersen
5d344c5e bb1459cb

+1 -2
+1 -2
drivers/scsi/pmcraid.c
··· 3584 3584 struct Scsi_Host *shost = class_to_shost(dev); 3585 3585 struct pmcraid_instance *pinstance = 3586 3586 (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); 3589 3588 u32 aen_group = pmcraid_event_family.id; 3590 3589 3591 3590 return snprintf(buf, PAGE_SIZE,