From patchwork Mon Dec 28 12:47:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352741 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9859005jai; Mon, 28 Dec 2020 08:11:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2QbYgyNNVv/8wSmQZJCF/s2i+OtgfonJppSZBSBMDdJ/RVMvfOQXC17re/dx1tZxd/zuW X-Received: by 2002:aa7:cc15:: with SMTP id q21mr43027967edt.213.1609171861035; Mon, 28 Dec 2020 08:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609171861; cv=none; d=google.com; s=arc-20160816; b=Pn6G7bpMbdhhemOKR4+Hc46OXP8EHk+DJCYIptBuz6fRqshGfd70uWT1UHKYeG+a5T JiwQF/BExH04S02MBITNgNO5CgOTHGjcqUfZq2M04E9LQxX+yKvqeBYpxmyDjtCCKq/q HoAKOTBxyduA8P+Fzu31TErBPAul/KJpZBt3Nj+Osa7XgsktPHc1Kq0PEHBTgniz7TZT fQgvUTQjhb0LXekPXQ/AXSGJFYIHaFocX0Z+jCYk/MIZ/TgFhpxu5ueRsrFu6x0ty3Zn autyl5MKLp2vDubwnCA41usSGI7EtH2ukwbEecXPbhXNlEV+jy6mmSJ951E08t2/8B9e pjOQ== 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=O7vLOnKrNw9O8DSXyC0fZwaa1rOutJz7kOhiX08/D5Y=; b=A1mOwvBCuYm7VIZeCzF6YLvaHdFjvpr7HLrWxBZFJNtjd0Uyg3PGDRNhAzMKdeSMOi FEC+xF2OT8VQidaugZG0HH5jFOCD+BenVvm/+znmUr8taXTn0Aiz0ChFLAKR72Rlgcbh Vpf2m2tEpHo95E1TaPWbtjgFsWLuUikybwR2LArS8HmTNRKpl0ekqDtZYIIacVkxU6/c lqut2B2KheDCyIH3mlRjm4A3RjlUn8ZQd7iZJoJctS7nAhY9Gx56L+Fb1SlR65VQXjZS NjUKZkzWUBw8mfUYpz4VoY0RsgCXBVSNEJ0ie6272/qQvjD0dk11OJXYe2dAnUbqZS67 kjpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RrbEW0lR; 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 35si21593002edm.126.2020.12.28.08.11.00; Mon, 28 Dec 2020 08:11:01 -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=RrbEW0lR; 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 S2389086AbgL1N0X (ORCPT + 14 others); Mon, 28 Dec 2020 08:26:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:55106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389090AbgL1N0V (ORCPT ); Mon, 28 Dec 2020 08:26:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2C6922AAA; Mon, 28 Dec 2020 13:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161941; bh=y7Mf1UPmifAMkf+SOqsQYtEqkkYTZRtWBfVzYkzGhLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RrbEW0lR6X3KsTTRHercUz5ggT/ad1hfTsEnyB9kbP/PPN/cUYY2Sr3JZDVNasBlG 7gf+4pKZPELImLaRDV+3/nticcq7hYLMUR86sSeAPUDH5LBDnzDUkw6WB2i2fnbmJP l5AVLRivmXVknqF9QoSMGJaojGngpKuaEQ6SxIhQ= 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 4.19 135/346] RDMa/mthca: Work around -Wenum-conversion warning Date: Mon, 28 Dec 2020 13:47:34 +0100 Message-Id: <20201228124926.315947835@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124919.745526410@linuxfoundation.org> References: <20201228124919.745526410@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 a5694dec3f2ee..098653b8157ed 100644 --- a/drivers/infiniband/hw/mthca/mthca_cq.c +++ b/drivers/infiniband/hw/mthca/mthca_cq.c @@ -609,7 +609,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 220a3e4717a35..e23575861f287 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 {