lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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

    \
     
     \ /
      Last update: 2021-11-12 00:51    [W:3.223 / U:1.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site