From patchwork Thu Sep 27 20:55:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10618547 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00C4A15A6 for ; Thu, 27 Sep 2018 20:57:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70072B94D for ; Thu, 27 Sep 2018 20:57:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA5F32B95D; Thu, 27 Sep 2018 20:57:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 835632B94D for ; Thu, 27 Sep 2018 20:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727331AbeI1DRS (ORCPT ); Thu, 27 Sep 2018 23:17:18 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38621 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727295AbeI1DRS (ORCPT ); Thu, 27 Sep 2018 23:17:18 -0400 Received: by mail-wm1-f65.google.com with SMTP id z16-v6so166475wmi.3; Thu, 27 Sep 2018 13:57:07 -0700 (PDT) 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=/MCnOWG9uwP6deUpl1LXHp074WRmvmwLGHPGftzWtNw=; b=mV7ljj6/D04ms6W4K8VcQy3W+16/jbN17Sz0e+JLLu4PUdw0yfHz0Ktl94dgML9ePt VYa01DK/NwZBHWeyRDVsFhDZCH6FwwYpPBAvMVhJwczL18mxRVUs7XC5R3YwZJU28kJt 4DfdPZEwTKWcuov/8HTJae8qtRI/6bjdjSecTQUJfcEtQ3RPevQBgxRHhnxulYJHfEee HMtFWbHKmlL8m4T1/ozxLFLJlHs6u15HfRL3/jMm0tRZ3nRSe2cCPu3FyhdHZo8zH8su HjLqFK+j++Z2ELfowCXdA2I+qUgKd3Dr2f9gMzPnoNh3fhXV1MX1WhI2KnicLtGYpE+g zUDA== 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=/MCnOWG9uwP6deUpl1LXHp074WRmvmwLGHPGftzWtNw=; b=KSjKsZz5OQAUG48JOUzmEu7AcpSKNoY0iGCorD+YNLcrkhpJMiorAuMsiyvUCb1/LP U5I259reXPxej54J5iEsXddisC7P0XiO3RRcnJQc1t9e1pPoggylITPjWxtjD0mhPjd3 YaNLuYTjLlO6UPkQLEAM0dPzSkV+m+U1GH7rQ9hWH8CA4El9IdyU3InDx6ksG3jDARrL JaqGn21jGdlDk6H/wz5tP0taftL+uRaue23GO0PgHVczGmNrGctMYcu2URFwWlMS8CP0 kQPvmdIxBRgM7BzenBOsWX+0sfBnrHJlwxUINpoJT49+Gb1NbiIn3G5ZfEofGiBHlWh3 atUg== X-Gm-Message-State: ABuFfoiivoeM5NKvNwlV7aRl9DblbIw9YiapXo3ANGX/3SCaZMdAdvwr UAlwW3O3eDIDLWi/62qkgkE= X-Google-Smtp-Source: ACcGV623lFMF7xzQXNsRPIByIr0YBivwPVM4LgY9tCEkcZuqp47qmXSV2LAIyXwsm2dPtpK8oIyLwQ== X-Received: by 2002:a1c:dac7:: with SMTP id r190-v6mr198351wmg.137.1538081826076; Thu, 27 Sep 2018 13:57:06 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id u23-v6sm4215886wrc.42.2018.09.27.13.57.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 13:57:05 -0700 (PDT) From: Nathan Chancellor To: Michal Kalderon , Ariel Elior , Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH v2] RDMA/qedr: Remove enumerated type qed_roce_ll2_tx_dest Date: Thu, 27 Sep 2018 13:55:58 -0700 Message-Id: <20180927205557.32026-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927011820.13608-1-natechancellor@gmail.com> References: <20180927011820.13608-1-natechancellor@gmail.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns when one enumerated type is explicitly converted to another. drivers/infiniband/hw/qedr/qedr_roce_cm.c:198:28: warning: implicit conversion from enumeration type 'enum qed_roce_ll2_tx_dest' to different enumeration type 'enum qed_ll2_tx_dest' [-Wenum-conversion] ll2_tx_pkt.tx_dest = pkt->tx_dest; ~ ~~~~~^~~~~~~ 1 warning generated. Turns out that QED_ROCE_LL2_TX_DEST_NW and QED_ROCE_LL2_TX_DEST_LB are only used once in the whole tree and QED_ROCE_LL2_TX_DEST_MAX is used nowhere. Remove them and use the equivalent values from qed_ll2_tx_dest in their place. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Acked-by: Michal Kalderon --- v1 -> v2: * Rather than using an explicit cast, just convert the uses to the appropriate values and delete the duplicated enum. drivers/infiniband/hw/qedr/qedr_roce_cm.c | 4 ++-- include/linux/qed/qed_rdma_if.h | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/infiniband/hw/qedr/qedr_roce_cm.c b/drivers/infiniband/hw/qedr/qedr_roce_cm.c index 85578887421b..e1ac2fd60bb1 100644 --- a/drivers/infiniband/hw/qedr/qedr_roce_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_roce_cm.c @@ -519,9 +519,9 @@ static inline int qedr_gsi_build_packet(struct qedr_dev *dev, } if (ether_addr_equal(udh.eth.smac_h, udh.eth.dmac_h)) - packet->tx_dest = QED_ROCE_LL2_TX_DEST_LB; + packet->tx_dest = QED_LL2_TX_DEST_LB; else - packet->tx_dest = QED_ROCE_LL2_TX_DEST_NW; + packet->tx_dest = QED_LL2_TX_DEST_NW; packet->roce_mode = roce_mode; memcpy(packet->header.vaddr, ud_header_buffer, header_size); diff --git a/include/linux/qed/qed_rdma_if.h b/include/linux/qed/qed_rdma_if.h index df4d13f7e191..d15f8e4815e3 100644 --- a/include/linux/qed/qed_rdma_if.h +++ b/include/linux/qed/qed_rdma_if.h @@ -39,15 +39,6 @@ #include #include -enum qed_roce_ll2_tx_dest { - /* Light L2 TX Destination to the Network */ - QED_ROCE_LL2_TX_DEST_NW, - - /* Light L2 TX Destination to the Loopback */ - QED_ROCE_LL2_TX_DEST_LB, - QED_ROCE_LL2_TX_DEST_MAX -}; - #define QED_RDMA_MAX_CNQ_SIZE (0xFFFF) /* rdma interface */ @@ -581,7 +572,7 @@ struct qed_roce_ll2_packet { int n_seg; struct qed_roce_ll2_buffer payload[RDMA_MAX_SGE_PER_SQ_WQE]; int roce_mode; - enum qed_roce_ll2_tx_dest tx_dest; + enum qed_ll2_tx_dest tx_dest; }; enum qed_rdma_type {