Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] PCI: Use header type defines in pci_setup_device()
@ 2025-06-10 10:58 Ilpo Järvinen
  2025-06-10 10:58 ` [PATCH 2/3] PCI: Cleanup early_dump_pci_device() Ilpo Järvinen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ilpo Järvinen @ 2025-06-10 10:58 UTC (permalink / raw)
  To: Krzysztof Wilczyński, Bjorn Helgaas, linux-pci, linux-kernel
  Cc: Ilpo Järvinen

Replace literals with PCI_HEADER_TYPE_* defines in pci_setup_device().

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/probe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4b8693ec9e4c..c00634e5a2ed 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1985,8 +1985,8 @@ int pci_setup_device(struct pci_dev *dev)
 	dev->sysdata = dev->bus->sysdata;
 	dev->dev.parent = dev->bus->bridge;
 	dev->dev.bus = &pci_bus_type;
-	dev->hdr_type = hdr_type & 0x7f;
-	dev->multifunction = !!(hdr_type & 0x80);
+	dev->hdr_type = FIELD_GET(PCI_HEADER_TYPE_MASK, hdr_type);
+	dev->multifunction = FIELD_GET(PCI_HEADER_TYPE_MFD, hdr_type);
 	dev->error_state = pci_channel_io_normal;
 	set_pcie_port_type(dev);
 

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
-- 
2.39.5


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

end of thread, other threads:[~2025-08-06 22:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 10:58 [PATCH 1/3] PCI: Use header type defines in pci_setup_device() Ilpo Järvinen
2025-06-10 10:58 ` [PATCH 2/3] PCI: Cleanup early_dump_pci_device() Ilpo Järvinen
2025-06-10 14:26   ` Sathyanarayanan Kuppuswamy
2025-06-10 10:58 ` [PATCH 3/3] PCI: Cleanup pci_scan_child_bus_extend() loop Ilpo Järvinen
2025-06-10 14:28   ` Sathyanarayanan Kuppuswamy
2025-06-10 14:26 ` [PATCH 1/3] PCI: Use header type defines in pci_setup_device() Sathyanarayanan Kuppuswamy
2025-08-06 22: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