linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/PCI: Use pci_dev_id() to simplify the code
@ 2023-08-15  2:24 Jialin Zhang
  2023-08-15 17:56 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Jialin Zhang @ 2023-08-15  2:24 UTC (permalink / raw)
  To: bhelgaas, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-pci, liwei391, wangxiongfeng2

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 mannually. Use pci_dev_id() to
simplify the code a little bit.

Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com>
---
 arch/x86/pci/pcbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 4f15280732ed..fc05ec31cabf 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -412,7 +412,7 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
 		"1:"
 		: "=a" (ret)
 		: "0" (PCIBIOS_SET_PCI_HW_INT),
-		  "b" ((dev->bus->number << 8) | dev->devfn),
+		  "b" (pci_dev_id(dev)),
 		  "c" ((irq << 8) | (pin + 10)),
 		  "S" (&pci_indirect));
 	return !(ret & 0xff00);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-15 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15  2:24 [PATCH] x86/PCI: Use pci_dev_id() to simplify the code Jialin Zhang
2023-08-15 17:56 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).