Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2482580imd; Fri, 2 Nov 2018 12:10:40 -0700 (PDT) X-Google-Smtp-Source: AJdET5fig2HF34zsVZ1Xflsky4dgjYy3BuB99Wfgtr1ao09BYimAFhk8lS24Aug+NqsCPQ18aiS/ X-Received: by 2002:a63:af45:: with SMTP id s5-v6mr11993439pgo.125.1541185840041; Fri, 02 Nov 2018 12:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541185840; cv=none; d=google.com; s=arc-20160816; b=BRnr1aQ3VnjQssfdobjVIinHJlmbtLhYFWur8q+e2CVkrvC3zuht3ucGRBRlaW6wlL lC4dNV6ihE4BYS+aZfKNd8xzk08X3GdhYeQ24wnb/3kdijctXQaDOjlQJTPJygkDG244 HBBDieR1f8kq+FKVYng+5xBxSybOFrJZggqlp6kPI4HfvJKfgIU1yLZ3OZj6upOspXo8 2uVCGrovdCypGpy28TA28KR4v8zhSpGmBAQ1CM+QFjxKyKFNa7L7krBhVi/wftgxlN5H 6x4YMd5+Dtf/u0wqYZr92AAFE6oCP8Cbj9tVKkRHV2PNdFtrQ32O+QZTeBYe7ZFVteVg nj1w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2sGyCl/Yic9p3Iwv1iv3uQZ19PYNKNrSYq9lqllHigE=; b=dVgnrX8VWeTmtyoBggXkapfKhTTj1tiON+LXdN//81VhhoKa2COLgR2HoIRMLtZ3gF mdI3YUzKjzbKDxWOwT8KRMqdxLxWB9Sejc3c/ylHJmijTXKP09mq4Q1oHi1b9U6MRFiy 9pgVSHXWaNvvPrdgNHTtJmnB8YLGGudPjVD93laOhmiAqtGleZsFnZFUSu/oEc9PJjpu XozYdRNXg38kSmgYvXaniUXRMF1PVRR4X+VQhNNJffHvrSs0bY4bi/Oe7q+3LoY/3GFk wIukqu5gt/wGtV6guihbbTvcs7fEqcsH9o5gtcysLpJJefE5IX8OaJ+78hi7ImgU3pOe JZwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v6v/N8Re"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2-v6si11685778plm.306.2018.11.02.12.10.25; Fri, 02 Nov 2018 12:10:39 -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=@kernel.org header.s=default header.b="v6v/N8Re"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729052AbeKCDrV (ORCPT + 99 others); Fri, 2 Nov 2018 23:47:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:41354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728545AbeKCDrU (ORCPT ); Fri, 2 Nov 2018 23:47:20 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EB7B2082E; Fri, 2 Nov 2018 18:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183949; bh=ySz/HzOO4EFUs0Qz2jDKFyovgjw/27VWmUCf0M5pZP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v6v/N8ReJeRG6n4HijL3MHc/OkNW+lnizdUArPS5OUdiAbFwLS84bOSPulXXqokEX m71Y2D/P4V4QA4CABL/zLFshu+DUuRBsWZA/uSFg6C39IDaIEAkShRdoIvOgyxe8bp KnpkJWCfgsSDv+yHbKMp7PoWr1LF/jGjnfkUe8Os= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 031/150] qed: Avoid implicit enum conversion in qed_roce_mode_to_flavor Date: Fri, 2 Nov 2018 19:33:13 +0100 Message-Id: <20181102182905.516924541@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d3a315795b4ce8b105a64a90699103121bde04a8 ] Clang warns when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_roce.c:153:12: warning: implicit conversion from enumeration type 'enum roce_mode' to different enumeration type 'enum roce_flavor' [-Wenum-conversion] flavor = ROCE_V2_IPV6; ~ ^~~~~~~~~~~~ drivers/net/ethernet/qlogic/qed/qed_roce.c:156:12: warning: implicit conversion from enumeration type 'enum roce_mode' to different enumeration type 'enum roce_flavor' [-Wenum-conversion] flavor = MAX_ROCE_MODE; ~ ^~~~~~~~~~~~~ 2 warnings generated. Use the appropriate values from the expected type, roce_flavor: ROCE_V2_IPV6 = RROCE_IPV6 = 2 MAX_ROCE_MODE = MAX_ROCE_FLAVOR = 3 While we're add it, ditch the local variable flavor, we can just return the value directly from the switch statement. Link: https://github.com/ClangBuiltLinux/linux/issues/125 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_roce.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c index b5ce1581645f..79424e6f0976 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c @@ -138,23 +138,16 @@ static void qed_rdma_copy_gids(struct qed_rdma_qp *qp, __le32 *src_gid, static enum roce_flavor qed_roce_mode_to_flavor(enum roce_mode roce_mode) { - enum roce_flavor flavor; - switch (roce_mode) { case ROCE_V1: - flavor = PLAIN_ROCE; - break; + return PLAIN_ROCE; case ROCE_V2_IPV4: - flavor = RROCE_IPV4; - break; + return RROCE_IPV4; case ROCE_V2_IPV6: - flavor = ROCE_V2_IPV6; - break; + return RROCE_IPV6; default: - flavor = MAX_ROCE_MODE; - break; + return MAX_ROCE_FLAVOR; } - return flavor; } void qed_roce_free_cid_pair(struct qed_hwfn *p_hwfn, u16 cid) -- 2.17.1