From patchwork Sat Jan 19 10:03:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 1027922 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SFg7ILCY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43hYQM2w5tz9sBQ for ; Sat, 19 Jan 2019 21:07:23 +1100 (AEDT) Received: from localhost ([127.0.0.1]:53764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gknX7-0003yp-A6 for incoming@patchwork.ozlabs.org; Sat, 19 Jan 2019 05:07:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gknTa-0001MR-Go for qemu-devel@nongnu.org; Sat, 19 Jan 2019 05:03:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gknTZ-000832-GO for qemu-devel@nongnu.org; Sat, 19 Jan 2019 05:03:42 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gknTZ-0007un-5M for qemu-devel@nongnu.org; Sat, 19 Jan 2019 05:03:41 -0500 Received: by mail-wr1-x441.google.com with SMTP id v13so17926835wrw.5 for ; Sat, 19 Jan 2019 02:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JdRyIjz11gpJSpvkLHp0MjuG5v+9KC0pq8K+iFDQ4sk=; b=SFg7ILCYOH4XoKcx8w31cTit/IYkDbJk3CIFmpsW7y5GbtgPolYlFakH3ruNIthhdd qMHMLhqr6Kvw6YFbRDbvEi0Phi/6NKDjD0w3toLlUOl1O12ayaq3aQN6uSC5Tu0vykqm tfGSd5v6MjaZpVGXCVz3diNzIrmEtnE2vtuDtmDsINgST9peOrT++kS+hOIF4Fb8CRsb D2Ajh/xobtc7pOTqQW5o5TJx5xmLmUNU7q+aTIRLswqwuNYCVKLLutMxJnO6sjYDwdHg 8eD8HVMuWCoUSyzMlnxgIm1DfJal5Jv1WOvL20RR/3NyTE4bMtxxspZrgtR59p3dfeWb Kj7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JdRyIjz11gpJSpvkLHp0MjuG5v+9KC0pq8K+iFDQ4sk=; b=R2HYfs/6ENpj+w7xLWMReZsfagwbisnjp71Nwk5UbRO7b1nWlpk0sX7lpBMpyeGZFG JJWHgIutW3dkmN0zv1IKuIhD7XCrmtViPxJrGngBXcXnrDrGEzeueiXvKzNC0ew1d5Pc +kXUBVLLC1ZzzMu1psGYqFwN6XM+5lo7kQXAO4OSzq38gFLi56npY6tOs/UHBPWVSuIp 3qA9LX8ekiMSb5cihvRqmKDYC3gZahmJVGBMt1niALgtFBQIpLzEMVE9SZsVu/mrtcIE GRdtWSnXvSZPwtX+P7NfA/WYkl/zyhMki2w4L5zfG/WXpsufUEVd1vkaV3QKIbgJCbla Z0MA== X-Gm-Message-State: AJcUukcPbeLT9nhZl9pJxhcSAjhkABzcxnxBzY394FsvbaQcAXsTntpx x4U4YlgFrOMo/9OhQTAzf6/OENp6 X-Google-Smtp-Source: ALg8bN5TqIQ685qKpz5usjqqy/riF8nB8LMybmZgFASMvX4VHh6udLS/SeeCG/cFPOxWLw2O4ge2GQ== X-Received: by 2002:adf:f5d1:: with SMTP id k17mr21426719wrp.59.1547892207122; Sat, 19 Jan 2019 02:03:27 -0800 (PST) Received: from localhost.localdomain ([176.228.155.165]) by smtp.gmail.com with ESMTPSA id j8sm113868847wmd.0.2019.01.19.02.03.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jan 2019 02:03:26 -0800 (PST) From: Marcel Apfelbaum To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Sat, 19 Jan 2019 12:03:10 +0200 Message-Id: <20190119100315.23985-6-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190119100315.23985-1-marcel.apfelbaum@gmail.com> References: <20190119100315.23985-1-marcel.apfelbaum@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH PULL 05/10] hw/pvrdma: Make function pvrdma_qp_send/recv return void. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cohuck@redhat.com, liq3ea@163.com, yuval.shaia@oracle.com, kamalheib1@gmail.com, philmd@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Yuval Shaia The functions handles errors internaly, callers have nothing to do with the return value. Signed-off-by: Yuval Shaia Message-Id: <20190109202140.4051-1-yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Marcel Apfelbaum --- hw/rdma/vmw/pvrdma_qp_ops.c | 14 ++++++-------- hw/rdma/vmw/pvrdma_qp_ops.h | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c index 0565eba981..ce5a60e184 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.c +++ b/hw/rdma/vmw/pvrdma_qp_ops.c @@ -143,7 +143,7 @@ int pvrdma_qp_ops_init(void) return 0; } -int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle) +void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle) { RdmaRmQP *qp; PvrdmaSqWqe *wqe; @@ -155,7 +155,8 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle) qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle); if (unlikely(!qp)) { - return -EINVAL; + pr_dbg("Invalid qpn\n"); + return; } ring = (PvrdmaRing *)qp->opaque; @@ -212,11 +213,9 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle) wqe = pvrdma_ring_next_elem_read(ring); } - - return 0; } -int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle) +void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle) { RdmaRmQP *qp; PvrdmaRqWqe *wqe; @@ -226,7 +225,8 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle) qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle); if (unlikely(!qp)) { - return -EINVAL; + pr_dbg("Invalid qpn\n"); + return; } ring = &((PvrdmaRing *)qp->opaque)[1]; @@ -262,8 +262,6 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle) wqe = pvrdma_ring_next_elem_read(ring); } - - return 0; } void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle) diff --git a/hw/rdma/vmw/pvrdma_qp_ops.h b/hw/rdma/vmw/pvrdma_qp_ops.h index ac46bf7fdf..31cb48ba29 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.h +++ b/hw/rdma/vmw/pvrdma_qp_ops.h @@ -20,8 +20,8 @@ int pvrdma_qp_ops_init(void); void pvrdma_qp_ops_fini(void); -int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle); -int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle); +void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle); +void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle); void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle); #endif