From patchwork Thu Feb 25 07:50:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 8420231 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7C682C0553 for ; Thu, 25 Feb 2016 07:51:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B539A20265 for ; Thu, 25 Feb 2016 07:51:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C372D2034A for ; Thu, 25 Feb 2016 07:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759703AbcBYHu7 (ORCPT ); Thu, 25 Feb 2016 02:50:59 -0500 Received: from cmrelayp1.emulex.com ([138.239.112.140]:52338 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1758002AbcBYHu6 (ORCPT ); Thu, 25 Feb 2016 02:50:58 -0500 Received: from neo01-el71.iig.avagotech.net ([10.192.204.61]) by CMRELAYP1.ad.emulex.com with Microsoft SMTPSVC(7.5.7601.17514); Wed, 24 Feb 2016 23:51:03 -0800 From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH 2/4] RDMA/libocrdma: Fix compile time warnings Date: Thu, 25 Feb 2016 02:50:45 -0500 Message-Id: <1456386647-22315-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1456386647-22315-1-git-send-email-devesh.sharma@broadcom.com> References: <1456386647-22315-1-git-send-email-devesh.sharma@broadcom.com> X-OriginalArrivalTime: 25 Feb 2016 07:51:03.0581 (UTC) FILETIME=[46A0B4D0:01D16FA1] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes couple of build warnings. Signed-off-by: Devesh Sharma --- src/ocrdma_verbs.c | 48 +++++++++++++----------------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c index c62ced0..f04b3d6 100644 --- a/src/ocrdma_verbs.c +++ b/src/ocrdma_verbs.c @@ -453,41 +453,24 @@ cmd_err: int ocrdma_modify_srq(struct ibv_srq *ibsrq, struct ibv_srq_attr *attr, int attr_mask) { - int status; - struct ocrdma_device *dev; - struct ocrdma_srq *srq; struct ibv_modify_srq cmd; - srq = get_ocrdma_srq(ibsrq); - dev = srq->dev; - - status = ibv_cmd_modify_srq(ibsrq, attr, attr_mask, &cmd, sizeof cmd); - return status; + return ibv_cmd_modify_srq(ibsrq, attr, attr_mask, &cmd, sizeof cmd); } int ocrdma_query_srq(struct ibv_srq *ibsrq, struct ibv_srq_attr *attr) { - int status; struct ibv_query_srq cmd; - struct ocrdma_device *dev; - struct ocrdma_srq *srq; - srq = get_ocrdma_srq(ibsrq); - dev = srq->dev; - status = ibv_cmd_query_srq(ibsrq, attr, &cmd, sizeof cmd); - return status; + return ibv_cmd_query_srq(ibsrq, attr, &cmd, sizeof cmd); } int ocrdma_destroy_srq(struct ibv_srq *ibsrq) { int status; - int id; struct ocrdma_srq *srq; - struct ocrdma_device *dev; srq = get_ocrdma_srq(ibsrq); - dev = srq->dev; - id = dev->id; status = ibv_cmd_destroy_srq(ibsrq); if (status) return status; @@ -668,6 +651,10 @@ enum ocrdma_qp_state get_ocrdma_qp_state(enum ibv_qp_state qps) return OCRDMA_QPS_SQE; case IBV_QPS_ERR: return OCRDMA_QPS_ERR; + case IBV_QPS_UNKNOWN: + break; + default: + break; }; return OCRDMA_QPS_ERR; } @@ -1096,10 +1083,9 @@ int ocrdma_destroy_qp(struct ibv_qp *ibqp) int status = 0; struct ocrdma_qp *qp; struct ocrdma_device *dev; - int id; + qp = get_ocrdma_qp(ibqp); dev = qp->dev; - id = dev->id; /* * acquire CQ lock while destroy is in progress, in order to * protect against proessing in-flight CQEs for this QP. @@ -2178,9 +2164,9 @@ int ocrdma_destroy_ah(struct ibv_ah *ibah) { int status; struct ocrdma_ah *ah; - struct ocrdma_device *dev; + ah = get_ocrdma_ah(ibah); - dev = ah->pd->dev; + status = ibv_cmd_destroy_ah(ibah); ocrdma_free_ah_tbl_id(ah->pd->uctx, ah->id); free(ah); @@ -2193,11 +2179,7 @@ int ocrdma_destroy_ah(struct ibv_ah *ibah) int ocrdma_attach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid, uint16_t lid) { - int status; - struct ocrdma_qp *qp; - qp = get_ocrdma_qp(ibqp); - status = ibv_cmd_attach_mcast(ibqp, gid, lid); - return status; + return ibv_cmd_attach_mcast(ibqp, gid, lid); } /* @@ -2206,17 +2188,13 @@ int ocrdma_attach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid, int ocrdma_detach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid, uint16_t lid) { - int status; - struct ocrdma_qp *qp; - qp = get_ocrdma_qp(ibqp); - status = ibv_cmd_detach_mcast(ibqp, gid, lid); - return status; + return ibv_cmd_detach_mcast(ibqp, gid, lid); } void ocrdma_async_event(struct ibv_async_event *event) { - struct ocrdma_cq *cq = NULL; - struct ocrdma_qp *qp = NULL; + struct ocrdma_cq *cq; + struct ocrdma_qp *qp; switch (event->event_type) { case IBV_EVENT_CQ_ERR: cq = get_ocrdma_cq(event->element.cq);