From patchwork Mon Sep 24 19:57:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10612829 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23A3E174A for ; Mon, 24 Sep 2018 19:57:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17262293F9 for ; Mon, 24 Sep 2018 19:57:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B13B2A38C; Mon, 24 Sep 2018 19:57:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A98D1293F9 for ; Mon, 24 Sep 2018 19:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbeIYCBO (ORCPT ); Mon, 24 Sep 2018 22:01:14 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41075 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbeIYCBO (ORCPT ); Mon, 24 Sep 2018 22:01:14 -0400 Received: by mail-wr1-f66.google.com with SMTP id j15-v6so16850597wrt.8; Mon, 24 Sep 2018 12:57:23 -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:mime-version :content-transfer-encoding; bh=slynOfZh8/YpEh4u3Pbm3hOCrbiS9AiZ0fFnoV25FiM=; b=RPU8lIaaA/BfEb8jM0kcz7gaMUaGZ7r8MMVqURISWu5omO/392r3++G7dn6orM8AiC PLjUim+SpZQWla1GREmpTwJuewTyqclc7GtCt5LOCuwjUZ1ala007plsFDE4mi5OqwXy MkohPSjF37k3Vh0z0XcTMgHm3Aq+FQEFpeS8qEhW3xXV/hS48HC9d1Hx0LoR5LZ1aqs1 FZlkkV00KwDC/FL+qEKp3UA2Td9myLttn8fyGdNon+1zDPvUxsyawdca13TBH+BcKQSy tkQsHekiE+EQDb8yJfw9tf5H+8U1q8E5QAQTv1N9MgGJf71sNBisLy6tA7ienuPsNiXh QSSQ== 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:mime-version :content-transfer-encoding; bh=slynOfZh8/YpEh4u3Pbm3hOCrbiS9AiZ0fFnoV25FiM=; b=hvsYVxBHgXL6AHV0hldNWcS6OuzfFJoTFIGSrkNgRVi7POKbLY46zntEKJYyt1JJ7H x1FziHURrfj6KGWlh5cdbIlflsu0XOL8VVNHbdbiPntwB3mBQgKJrAUX9YZxG0+ded0B 3b8RymNYgUjQjgvlhKl6KGV66OjNNoRrkBHjw8Yi3YaVv20hKQv1yc7IAU/Q/x+ZYzRz cEahO1GmWaPM0bR6gtvJuRJ8oyyRb6h/ai+izGsiKnsr4Q6bW5m0xfoxYPZfXxkHZyla dwg1sz9Rk1nC5VUAytt5rj/obVN4cqLVNQ6t4t4ECmxcTr/wVQ/bGhpLSEUhxlZJIQ52 G2VA== X-Gm-Message-State: ABuFfoiwHILMDzgdTPaQIWbACBP5G9h7Y85lH5V5HYDxXgvTr/REYSdO xsscoSmH0+7IvmaYl5kSdTY= X-Google-Smtp-Source: ACcGV63vPYSxKV2fUY0kVYbQjpxMbBqMmusAJYOajWoKSGonF5th7f+eSHqJz4LUMVwYIplN+lUCiA== X-Received: by 2002:adf:b2b5:: with SMTP id g50-v6mr256954wrd.218.1537819042137; Mon, 24 Sep 2018 12:57:22 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id t4-v6sm305155wrb.45.2018.09.24.12.57.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 12:57:20 -0700 (PDT) From: Nathan Chancellor To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion Date: Mon, 24 Sep 2018 12:57:16 -0700 Message-Id: <20180924195716.30848-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns when one enumerated type is implicitly converted to another. drivers/infiniband/hw/mlx4/mad.c:1811:41: warning: implicit conversion from enumeration type 'enum mlx4_ib_qp_flags' to different enumeration type 'enum ib_qp_create_flags' [-Wenum-conversion] qp_init_attr.init_attr.create_flags = MLX4_IB_SRIOV_TUNNEL_QP; ~ ^~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/mlx4/mad.c:1819:41: warning: implicit conversion from enumeration type 'enum mlx4_ib_qp_flags' to different enumeration type 'enum ib_qp_create_flags' [-Wenum-conversion] qp_init_attr.init_attr.create_flags = MLX4_IB_SRIOV_SQP; ~ ^~~~~~~~~~~~~~~~~ The type mlx4_ib_qp_flags explicitly provides supplemental values to the type ib_qp_create_flags. Make that clear to Clang by changing the create_flags type to u32. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- include/rdma/ib_verbs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e463d3007a35..f6f4d9e3c8ed 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1149,7 +1149,7 @@ struct ib_qp_init_attr { struct ib_qp_cap cap; enum ib_sig_type sq_sig_type; enum ib_qp_type qp_type; - enum ib_qp_create_flags create_flags; + u32 create_flags; /* * Only needed for special QP types, or when using the RW API.