From: Ilpo Järvinen Date: Tue, 10 Jun 2025 10:58:18 +0000 (+0300) Subject: PCI: Use header type defines in pci_setup_device() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=24b2d3c452e5f3facaf9c664aaaa9fc7fa4bc6bb;p=users%2Fhch%2Fmisc.git PCI: Use header type defines in pci_setup_device() Replace literals with PCI_HEADER_TYPE_* defines in pci_setup_device(). Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Link: https://patch.msgid.link/20250610105820.7126-1-ilpo.jarvinen@linux.intel.com --- diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index f41128f91ca7..505e9a602118 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);