aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMao Zhongyi <maozy.fnst@cn.fujitsu.com>2017-06-27 14:16:48 +0800
committerMichael S. Tsirkin <mst@redhat.com>2017-07-03 22:29:48 +0300
commiteacbc63211c18ad56eb5a3835683663462b131b2 (patch)
treebbc9b65e5130b6b048dc839010d42ba5766742c7
parent673b0d7ccc34e9617d99ed4c29caa964f19a4c5a (diff)
pci: Add comment for pci_add_capability2()
Comments for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: mst@redhat.com Cc: marcel@redhat.com Cc: armbru@redhat.com Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/pci/pci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 3c24888870..3370b76164 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2276,6 +2276,12 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
return ret;
}
+/*
+ * On success, pci_add_capability2() returns a positive value
+ * that the offset of the pci capability.
+ * On failure, it sets an error and returns a negative error
+ * code.
+ */
int pci_add_capability2(PCIDevice *pdev, uint8_t cap_id,
uint8_t offset, uint8_t size,
Error **errp)