Skip to content

Commit a46421f

Browse files
Jialin Zhangmartinkpetersen
authored andcommitted
scsi: megaraid_sas: 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: Jialin Zhang <zhangjialin11@huawei.com> Link: https://lore.kernel.org/r/20230815025419.3523236-3-zhangjialin11@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 48e5902 commit a46421f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7518,7 +7518,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
75187518
*/
75197519
instance->pdev = pdev;
75207520
instance->host = host;
7521-
instance->unique_id = pdev->bus->number << 8 | pdev->devfn;
7521+
instance->unique_id = pci_dev_id(pdev);
75227522
instance->init_id = MEGASAS_DEFAULT_INIT_ID;
75237523

75247524
megasas_set_adapter_type(instance);

0 commit comments

Comments
 (0)