From patchwork Mon Dec 28 12:46:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352652 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9756533jai; Mon, 28 Dec 2020 05:44:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1aqIQtsJ/K6xL/1jt16EArIysTtX8t3TEzlsln7j9kIlUjhNRb0P5KqBbcIsgDidzAsFt X-Received: by 2002:a05:6402:b88:: with SMTP id cf8mr43287852edb.140.1609163070805; Mon, 28 Dec 2020 05:44:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609163070; cv=none; d=google.com; s=arc-20160816; b=NtkvFHDjsVCJPSJT/4pZgYgAX/Ggm86V7gvKqKcEa8GHiR3hn3tTrFAkkyCgn6wZp3 FUd2/n2/UgDbuFuF/wgxEhDw95KCqv3wn7urlAq9Yz4fJUD3kfZK43BpRvx+XKS/zDmq V+juzI8bXAuUI2K9ne9ru4gdAppEsdcUaHr4CrgPHYrvJRHEUsVZJRykvin4rQAvvYhD AZKLkT91NEUKrSWetBILkfKy1TEczfcF4E3ZFhcSagKQ0LV4hdfz6DKv5OfRSk8Hz4oD /MvVn90Ipx3GzyPmhrzHFjQyMlqY78pVhpzCVY/m/E3K4MotqgwX7NjHrwyR/GOMlaW0 2Ebw== 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=hDZwjuNZP9POqCB/GDgmocPFO+TYIUW1aguzY/VXvH4=; b=Jqk87y4jjrkbKwMWyHQScyNcF4nXWrtG7JgNrmX2aA9aIvjnxU9HQ3uBKNWpYqdAMQ hg8b0XjOMht+Tl424Vu5cdjch+JpbubwCm614vEEC4RyBPOpNppCXyuR05cq1/EGWWmc J7XSwgrQRj2EDMTH+6r7v8pLN5eOe49Qi5ObbxWE3R/rzb5+izpcRjFGqozua+h84H+p 2swMIwGMxhYg26YYL/c8guGjhL8Egdw+o/OWkLRPo+YjNjSXNxCuI84lRzO4G2SEvWCA olJ5U2As1UjolZGRk//mKhG4cdvdvsextXqlO31aSs1eHcJ8uGdLM34ICGWRWXMLUJCX EBxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SGrzd6uj; 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 v25si18990776ejx.201.2020.12.28.05.44.30; Mon, 28 Dec 2020 05:44:30 -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=SGrzd6uj; 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 S2404446AbgL1NnR (ORCPT + 14 others); Mon, 28 Dec 2020 08:43:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:43378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404441AbgL1NnQ (ORCPT ); Mon, 28 Dec 2020 08:43:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E519820731; Mon, 28 Dec 2020 13:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162980; bh=tcm3hy+Kvs/ttSTig7YLBWJy0rFbu6SrNmbnPn61H2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGrzd6uj7a1fG8It15jhM8PJxvN9o9qM+umWShcZoQfpW99KAUKOKQHDyiv8eoL4F tGf7hEuxtWKF6AX08K84fCUUrGHpEDTnd3L/qNfJ8QGxPqmNhm2SBuKnYbSqUe0cSV Bec6mmD6ce0ddo8Xif1sI2h1Fkjy9afjz+P6Qn98= 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.4 127/453] RDMa/mthca: Work around -Wenum-conversion warning Date: Mon, 28 Dec 2020 13:46:03 +0100 Message-Id: <20201228124943.329214273@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@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 bfd4eebc1182f..58d46449b0e86 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 {