Re: [PATCH v2 09/10] PCI: Add function to convert lnkctl2speed to pci_bus_speed
From: Bjorn Helgaas
Date: Thu Mar 13 2025 - 13:19:36 EST
On Thu, Mar 13, 2025 at 05:10:16PM +0530, Krishna Chaitanya Chundru wrote:
> Add a exported function to convert lnkctl2speed to enum pci_bus_speed,
> so that other kernel drivers can use it.
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@xxxxxxxxxxxxxxxx>
> ---
> drivers/pci/pci.c | 12 ++++++++++++
> include/linux/pci.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 869d204a70a3..75505437a9c9 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -6011,6 +6011,18 @@ int pcie_link_speed_mbps(struct pci_dev *pdev)
> }
> EXPORT_SYMBOL(pcie_link_speed_mbps);
>
> +/**
> + * pci_lnkctl2_bus_speed - converts lnkctl2 speed to pci_bus_speed
I try to use imperative mood ("convert lnkctl2") to match commit log
style.
> + * @speed: LNKCAP2 SLS value
> + *
> + * Returns pci_bus_speed
Not sure how strict kernel-doc is about this, but I've been told
it wants "Return:" with a colon here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/doc-guide/kernel-doc.rst?id=v6.13#n142