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

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>

authored by

Jialin Zhang and committed by
Martin K. Petersen
a46421fd 48e59021

+1 -1
+1 -1
drivers/scsi/megaraid/megaraid_sas_base.c
··· 7518 7518 */ 7519 7519 instance->pdev = pdev; 7520 7520 instance->host = host; 7521 - instance->unique_id = pdev->bus->number << 8 | pdev->devfn; 7521 + instance->unique_id = pci_dev_id(pdev); 7522 7522 instance->init_id = MEGASAS_DEFAULT_INIT_ID; 7523 7523 7524 7524 megasas_set_adapter_type(instance);