From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS7HA-0007W0-VH for qemu-devel@nongnu.org; Mon, 03 Jul 2017 15:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS7HA-0002e2-4P for qemu-devel@nongnu.org; Mon, 03 Jul 2017 15:44:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44428) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dS7H9-0002dJ-UU for qemu-devel@nongnu.org; Mon, 03 Jul 2017 15:44:52 -0400 Date: Mon, 3 Jul 2017 22:44:45 +0300 From: "Michael S. Tsirkin" Message-ID: <1499111049-13721-6-git-send-email-mst@redhat.com> References: <1499111049-13721-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1499111049-13721-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 05/21] pci: Add comment for pci_add_capability2() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Mao Zhongyi , mst@redhat.com, marcel@redhat.com, armbru@redhat.com From: Mao Zhongyi 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 --- hw/pci/pci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 3c24888..3370b76 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) -- MST