Messages in this thread | | | Date | Fri, 12 Nov 2021 00:50:44 +0100 | From | Krzysztof Wilczyński <> | Subject | Re: [PATCH v8 4/8] PCI/portdrv: Create pcie_is_port_dev() func from existing code |
| |
Hi Jim,
[...] > +bool pcie_is_port_dev(struct pci_dev *dev) > +{ > + int type; > + > + if (!dev) > + return false; > + > + type = pci_pcie_type(dev); > + > + return pci_is_pcie(dev) && > + ((type == PCI_EXP_TYPE_ROOT_PORT) || > + (type == PCI_EXP_TYPE_UPSTREAM) || > + (type == PCI_EXP_TYPE_DOWNSTREAM) || > + (type == PCI_EXP_TYPE_RC_EC)); > +} > +EXPORT_SYMBOL_GPL(pcie_is_port_dev);
It would be really nice to document what the above function does (not that some of the logic has been extracted from other function). You know, for the future generations of kernel hackers.
Krzysztof
| |