[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131120161808.GI28946@htj.dyndns.org>
Date: Wed, 20 Nov 2013 11:18:08 -0500
From: Tejun Heo <tj@...nel.org>
To: Alexander Gordeev <agordeev@...hat.com>
Cc: linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>,
Michael Ellerman <michael@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Ben Hutchings <bhutchings@...arflare.com>,
David Laight <David.Laight@...LAB.COM>,
Mark Lord <kernel@...rt.ca>, "H. Peter Anvin" <hpa@...or.com>,
linux-pci@...r.kernel.org
Subject: Re: [PATCH RFC v2 09/29] PCI/MSI: Factor out pci_get_msi_cap()
interface
Hello,
On Fri, Oct 18, 2013 at 07:12:09PM +0200, Alexander Gordeev wrote:
> +If this function returns a negative number, it indicates the device is
> +not capable of sending MSIs.
Wouldn't "errno" better describe the error return rather than
"negative number"?
> @@ -795,6 +795,21 @@ static int pci_msi_check_device(struct pci_dev *dev, int nvec, int type)
> return 0;
> }
We probably want a function comment here?
> +int pci_get_msi_cap(struct pci_dev *dev)
> +{
> + int ret;
> + u16 msgctl;
> +
> + if (!dev->msi_cap)
> + return -EINVAL;
> +
> + pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &msgctl);
> + ret = 1 << ((msgctl & PCI_MSI_FLAGS_QMASK) >> 1);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL(pci_get_msi_cap);
Other than that,
Reviewed-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists