From patchwork Mon Dec 28 12:41:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352661 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9772966jai; Mon, 28 Dec 2020 06:08:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgtd2ec5fHF3hhmTXJXZNbWPYJirzelk+b2EGY571xWv9Uz67N7p0H3XtCO0eegCVnfcat X-Received: by 2002:aa7:c919:: with SMTP id b25mr41252204edt.108.1609164486613; Mon, 28 Dec 2020 06:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164486; cv=none; d=google.com; s=arc-20160816; b=rcleXTSGITcid4OAIqm/fQL17FFYGIrkjkqefcbjTGwn4AvD85we40N/HfSSMi0Me4 9wg928Mjc9tcWGPQF3KH0/1yQGGxFfx/DEyKwL0NYZoC0WxTLXARSIG66Ef6+P8wpc9k kzeLVjbdldhqdEedDsm9oO63IC1DeMM96R4oHemHo/UIVh6W2v/bWkQVZtZHp+TVsXVi 9puMfZ1Ljic/W1Kq6Hpfj+UckjqJ+0BixABeTLAxQ3M5zSk91t72lH0LJ6WqTFM2rb2n w2UvRPeIIDUox8S9G4NXz8pNvmSM2nM4tTWd/Rg8nhie7o2ubUI0LZ9K2OvQKPboD/MC UzQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wr99xOrL8xQgcS5kVrnWR7xMsvu0fTxpeMEGkf9YyW8=; b=TCsWWIfSZSd7EoHCqPGAWodgNtAfGns15Vg3/Md0ejplm215kuNfamFqvpd5D5Dc/c PyXfZboTh9/XYbhoV5ErJjqFlPoEZ7UIvZNrz97cMvonQDQyhnF00TwvGVc3UjafTSyh wcCg5bFO6HkshI7o08u0DF5Iz7EGns0l5ssnCbcAsJecO9pE2qgtHhYAkuE1n6COOg0Y uZAWBdyJWz52FzFPpeMTRKCm4ySkYeWIAVlq9FSq49CV+Esvld4x8EMuPyv+LAmwKyO/ 6RHJEGxRZSkuMJB+br/ilkkEb0Enah42EI5pKCPXBXDx4Y44w2r9rL/0x7ze3p9A6oGX +0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GH+NN1A8; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id np6si18982500ejb.609.2020.12.28.06.08.06; Mon, 28 Dec 2020 06:08:06 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GH+NN1A8; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437306AbgL1OEQ (ORCPT + 14 others); Mon, 28 Dec 2020 09:04:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:38432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437302AbgL1OEP (ORCPT ); Mon, 28 Dec 2020 09:04:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7054206D4; Mon, 28 Dec 2020 14:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164214; bh=0/ZqALBnNmKoH+sFsadT8YvHXeWiPgEg7lSdxLv5SKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GH+NN1A8ARowwBhkq72Kll+1tm8DYYwYJQNrH/TUWqc+yKHzI985SVAEf2EYlCQMn utmnaF2Zft8DmFGyofB7BCuFKZVpbYh3YCyHCRVo9hRgHz6dYhx113bq0L19TPZjRn rMkawtO1HVcPSIPzr/33pRf85uM6GUi4q8Xvn5EQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 101/717] RDMa/mthca: Work around -Wenum-conversion warning Date: Mon, 28 Dec 2020 13:41:39 +0100 Message-Id: <20201228125025.814154903@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit fbb7dc5db6dee553b5a07c27e86364a5223e244c ] gcc points out a suspicious mixing of enum types in a function that converts from MTHCA_OPCODE_* values to IB_WC_* values: drivers/infiniband/hw/mthca/mthca_cq.c: In function 'mthca_poll_one': drivers/infiniband/hw/mthca/mthca_cq.c:607:21: warning: implicit conversion from 'enum ' to 'enum ib_wc_opcode' [-Wenum-conversion] 607 | entry->opcode = MTHCA_OPCODE_INVALID; Nothing seems to ever check for MTHCA_OPCODE_INVALID again, no idea if this is meaningful, but it seems harmless as it deals with an invalid input. Remove MTHCA_OPCODE_INVALID and set the ib_wc_opcode to 0xFF, which is still bogus, but at least doesn't make compiler warnings. Fixes: 2a4443a69934 ("[PATCH] IB/mthca: fill in opcode field for send completions") Link: https://lore.kernel.org/r/20201026211311.3887003-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/infiniband/hw/mthca/mthca_dev.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c index 119b2573c9a08..26c3408dcacae 100644 --- a/drivers/infiniband/hw/mthca/mthca_cq.c +++ b/drivers/infiniband/hw/mthca/mthca_cq.c @@ -604,7 +604,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev, entry->byte_len = MTHCA_ATOMIC_BYTE_LEN; break; default: - entry->opcode = MTHCA_OPCODE_INVALID; + entry->opcode = 0xFF; break; } } else { diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h index 9dbbf4d16796a..a445160de3e16 100644 --- a/drivers/infiniband/hw/mthca/mthca_dev.h +++ b/drivers/infiniband/hw/mthca/mthca_dev.h @@ -105,7 +105,6 @@ enum { MTHCA_OPCODE_ATOMIC_CS = 0x11, MTHCA_OPCODE_ATOMIC_FA = 0x12, MTHCA_OPCODE_BIND_MW = 0x18, - MTHCA_OPCODE_INVALID = 0xff }; enum {