From patchwork Thu Aug 31 12:42:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9932131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2757A603B4 for ; Thu, 31 Aug 2017 12:42:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18FA82895D for ; Thu, 31 Aug 2017 12:42:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DDE02895F; Thu, 31 Aug 2017 12:42:54 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 A6E2C28961 for ; Thu, 31 Aug 2017 12:42:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750895AbdHaMmv (ORCPT ); Thu, 31 Aug 2017 08:42:51 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:56058 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751385AbdHaMmv (ORCPT ); Thu, 31 Aug 2017 08:42:51 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 31 Aug 2017 15:42:45 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v7VCgjd8023275; Thu, 31 Aug 2017 15:42:45 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id v7VCgjoi010830; Thu, 31 Aug 2017 15:42:45 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v7VCgjX9010829; Thu, 31 Aug 2017 15:42:45 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, leonro@mellanox.com, majd@mellanox.com Subject: [PATCH V1 rdma-core 2/2] mlx5: Fix compile warning upon calling _mm_set_epi8() Date: Thu, 31 Aug 2017 15:42:26 +0300 Message-Id: <1504183346-10742-3-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1504183346-10742-1-git-send-email-yishaih@mellanox.com> References: <1504183346-10742-1-git-send-email-yishaih@mellanox.com> 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 From: Leon Romanovsky The _mm_shuffle_epi8 call requires 0x80 to set the output byte to zero, but _mm_set_epi8() accepts char. If GCC is compiling in a configuration with a signed char then it can produce a -Werror=overflow warning. Fixing that by considering the value of CHAR_MIN at the compilation phase to pass the matching char value. Fixes: 00c91653ef9a ("mlx5: Add WQE segments implementation") Signed-off-by: Leon Romanovsky Reviewed-by: Yishai Hadas --- providers/mlx5/mlx5dv.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h index 5d11625..2219e62 100644 --- a/providers/mlx5/mlx5dv.h +++ b/providers/mlx5/mlx5dv.h @@ -36,6 +36,7 @@ #include /* For the __be64 type */ #include #if defined(__SSE3__) +#include #include #include #endif /* defined(__SSE3__) */ @@ -499,7 +500,11 @@ void mlx5dv_x86_set_ctrl_seg(struct mlx5_wqe_ctrl_seg *seg, uint16_t pi, (signature << 24) | (opcode << 16) | (opmod << 8) | fm_ce_se); __m128i mask = _mm_set_epi8(15, 14, 13, 12, /* immediate */ 0, /* signal/fence_mode */ - 0x80, 0x80, /* reserved */ +#if CHAR_MIN + -128, -128, /* reserved */ +#else + 0x80, 0x80, /* reserved */ +#endif 3, /* signature */ 6, /* data size */ 8, 9, 10, /* QP num */