From: Mao Zhongyi Date: Tue, 27 Jun 2017 06:16:48 +0000 (+0800) Subject: pci: Add comment for pci_add_capability2() X-Git-Tag: v2.10.0-rc0~95^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eacbc63211c18ad56eb5a3835683663462b131b2;p=thirdparty%2Fqemu.git 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 Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 3c248888709..3370b761641 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)