From: Jialin Zhang Date: Tue, 15 Aug 2023 02:54:19 +0000 (+0800) Subject: scsi: megaraid: Use pci_dev_id() to simplify the code X-Git-Tag: v6.6.7~1928^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb1459cb84da009bb4c5faed4a2647ce3810bdca;p=platform%2Fkernel%2Flinux-starfive.git scsi: megaraid: 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 Link: https://lore.kernel.org/r/20230815025419.3523236-4-zhangjialin11@huawei.com Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index ef2b638..bc867da 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -438,7 +438,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) // set up PCI related soft state and other pre-known parameters - adapter->unique_id = pdev->bus->number << 8 | pdev->devfn; + adapter->unique_id = pci_dev_id(pdev); adapter->irq = pdev->irq; adapter->pdev = pdev;