Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2496891imm; Thu, 27 Sep 2018 13:57:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV60GfuKW5Ose7DXE1upfPNm+ofS2m4xK11sp+cH0LCPQtI7sVzkcX54V67JymzxA3f7P4W0Y X-Received: by 2002:a63:5445:: with SMTP id e5-v6mr12040296pgm.316.1538081867629; Thu, 27 Sep 2018 13:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538081867; cv=none; d=google.com; s=arc-20160816; b=hwtFBMdcNtv7y/szSDlu95skeVQK3AyVjdar4atSwBGghHtSPC6rIF9NK+qA6oFEVU 1GJLFAo/xY9suzTMU+f0yf4rFzkq7mb28GHps+gS5Ccla9t6pqr7Wqv2lRjeBXxwCTri HKjKDUEcN10PC+9X/ECMGHlEopP5vQjedsypk01Qnt7hkAOEWN/eUURceYZWFXwXsC+C rpAGXwHDeF0V17JoHgeVIcIAaTzTlyjEG85srSQYunac/fbjHk2HQrbOx6uxaD72L6nR Sw4ls3f3+AYSQLJCD1sGVnlF3YUzHLeEkQ0cgr+i/hKtfVPuMDF/YXQKGtVz3ZE9Usav g+EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/MCnOWG9uwP6deUpl1LXHp074WRmvmwLGHPGftzWtNw=; b=qAFymZzzloumWWZnNTQi4/9VB5zG3YjkCoekMZfT923y+fxgfbdQ9VsH7ZKJg27c3r ALsJaZZuo91Jf3yTTyNWP5d8+NyvfeSGQrfNPBQErl8N1mzJ3gtO2TLLb5EWol91gtyM BzyAJ5WIiKsIfjv2je1XcGGpGR1IVhF3ypZNxl2GWo+kASSEGmf8TkXbyEmlj2racoRQ OcPtkp8VW7M4K6ycbE6/ukMxV420h27/iseFgvxk1JUGlqKqPATVSL7k2xWBo0SdZbTp GePppGsncXPJRL6U2+9RzNabiko2TjqH4scSB8WSDTR6JQyB4K/pkCswhVwSit8kywPk ZFdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mV7ljj6/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si3117045pfm.93.2018.09.27.13.57.31; Thu, 27 Sep 2018 13:57:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mV7ljj6/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728375AbeI1DRS (ORCPT + 99 others); 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-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 { -- 2.19.0