From patchwork Thu Feb 8 23:38:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10208133 X-Patchwork-Delegate: leon@leon.nu 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 70C6060134 for ; Thu, 8 Feb 2018 23:38:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 629CD296D2 for ; Thu, 8 Feb 2018 23:38:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57251296EB; Thu, 8 Feb 2018 23:38:40 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A0AB3296D2 for ; Thu, 8 Feb 2018 23:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbeBHXii (ORCPT ); Thu, 8 Feb 2018 18:38:38 -0500 Received: from mail-db5eur01on0045.outbound.protection.outlook.com ([104.47.2.45]:30929 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751963AbeBHXih (ORCPT ); Thu, 8 Feb 2018 18:38:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Yvd/YeX7Hg+JUhcwxGMvkPfrKmhEGUzTiDwS3hqGBSs=; b=VXrqXnj1IwlJR9oGsUJPNaQ1D4hE++XTce1tX0T9jNLGEduT9hPry+QQ+C0UIJi1vpJej+OqE5SGIhrGOqm4pknfglpzJI/1GjFI3kl5zyPzCVA5/CkDr4r8ZzwjOP9BOQLf7XMw6S6Z9i8Otm+7Q9/0b8+pSdul2CiUOQfihG0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (70.74.179.152) by AM4PR0501MB2850.eurprd05.prod.outlook.com (2603:10a6:200:5c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Thu, 8 Feb 2018 23:38:34 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1ejvlt-0004Ch-2a for linux-rdma@vger.kernel.org; Thu, 08 Feb 2018 16:38:29 -0700 Date: Thu, 8 Feb 2018 16:38:29 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Subject: [PATCH rdma-core] mlx4: Fix 1<<31 expressions Message-ID: <20180208233829.GA16128@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: DB6PR1001CA0033.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::19) To AM4PR0501MB2850.eurprd05.prod.outlook.com (2603:10a6:200:5c::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a02ee292-2bc0-4f42-ab23-08d56f4d1208 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2850; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2850; 3:/pUoa1CuO8k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+uy0Ed3mvHsKp0ctESIJJclCDXtTpOebmHBP+vax+CamXpbLQL7Z3eIKoNIZkS7jI8Wt6es0ufC+pwdrfb2iQMLl9KJGqw0kHVR/ldnh8ONKn328dzGL19aTPUnhphT3Bxpx9O92W0BhBC/gx5Idx9glAL45yN1jXdbuddN6k+8GLky+233rUSQ6KY9G3dF/U8qx++qPR66OQejgA/YuxDsa9A51Hzf/zFOfWLQYiqIQqDXAfsH4mixH17Sk/SdgxXbRbyUAjr0bXucN6ndziXa+Fgcu+B3ZhItXgZZ/cAEpi1drG4f4gZnQXcoGV801haB6hq8wDrGsy3KTnZez76TNfD3SK6P; 4:8zR3X7BzcpOjhPCqWQadHBlD8ytzTPZcdzeNkS/8vAJyOpLGvWJq+cWmXDbgwIt9LN0bZQRHS3ae57bLC+gUEbKrMRxlW8rR8ZLmJjxgOhb1k5pPzXKW7jSjRKqCp70ku4b4fu/9S/oNz889FV+XOgZLLCDnTb3YZlbp0V8HNt9tsyJRJ4PFXmxsbMBXdX/Nq8GLICd6Y8jbFAF91Wxi3InREZF0HbMY51T+yO67hmhxWVrs3oRQhR4zSODXo10qMWXB/3ekRbYghVg+lBWy1g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231101)(2400082)(944501161)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR0501MB2850; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2850; X-Forefront-PRVS: 0577AD41D6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(39380400002)(39860400002)(346002)(199004)(189003)(6916009)(9746002)(26005)(69596002)(8676002)(81166006)(81156014)(8936002)(9786002)(83506002)(3846002)(23726003)(386003)(6116002)(33656002)(1076002)(2906002)(33896004)(305945005)(2361001)(97736004)(2351001)(105586002)(57986006)(7736002)(68736007)(52116002)(36756003)(5660300001)(47776003)(66066001)(46656002)(122856001)(58126008)(16586007)(53936002)(9686003)(106356001)(83796002)(478600001)(316002)(86362001)(186003)(50466002)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2850; H:mlx.ziepe.ca; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0501MB2850; 23:PXx3mCZIic9LnJC+88fXSyJe+uIEkm3gUA7eamy?= =?us-ascii?Q?kFQygoncJYHglyv6Oll28A2mjMVMsrgjBiB4RwvRJKv/vO50a2bbQV6F/r16?= =?us-ascii?Q?KLyueWIy2yADhNbhqHpphHpKN3Yu5ECvEW4WEyJTYTVNdvFTG6bWy20xhdtp?= =?us-ascii?Q?odkSp8r2Q3ouCT+U1sT9+bIEqUqdnindPGhZfCZHyA814x57Vl6nZE/ug9tL?= =?us-ascii?Q?5nKszwmKSVOZpHiSLBGLO0fgV7PGheaMYA/0zFyM5sTtJHSEFIlhstw5eJAT?= =?us-ascii?Q?rO8xS/Dp2qBqHAqp607HLBfrLMajIYEyFOU4lcDVrTyZy31XF81/ixoCVsxB?= =?us-ascii?Q?ND/3f8tj0B4YUi6RjCi/gfw88Yrm/xAnU3Uh4PWWlNkUDCUAvXgRpT9eGLpQ?= =?us-ascii?Q?lHthjQ+QbJPR7rGw+dQ8PWgG3wzTjMHPH7phOr6pliaFoNLnb+kQ9JIaJI9M?= =?us-ascii?Q?qSnwTSRztFWvf9AKTtTuliKPfFvd96YaEgiAqjgBjyIHHXw5ll5PpQX6ALll?= =?us-ascii?Q?wEqKzygaFyawWT918IoRNuMIlIPdGmNyC+2ztsEdkcXRWsAe7RiAwh+ECe4O?= =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GjPn+1h7+c8f5ncxuSKpe1yQH32CTIPcM4IY67nl28owcX6osLoceSd1KZ1HBh+csYGGOA3nPWnhBBCAEYYqdtiIW+AxZJk0EDJxWFafYWL2e3RIOQj4NBmBbt7YoJ3MsF0tMS3oUMowck1TCM1F4CJDvsUYbeL7jEMbh9wqWbM+TxfvnCiG0ICcZsrRxjFZM=; 5:2Uc9L8xv+oIdouq5EVCbTSDamC6UnpyLyRU+wVoSr/lDr/KbGQ5Hl4UkZV3ZiUvv64KcTS+R4QjTRnrzUxVzIzEBfO5ysYJO1WAht0SwxK+Ka5O02vWoeufcrgiZpawMYnfQtrx2rmXI/ZKfCuxX1Nkd4UijG+txJ6qmYxc0S/g=; 24:WacwEV2BkuAMOZHD96AwU2Wcl8rhtJrJzcuvofd+KbsjlN5RiN3+XV5pGvcp0zRVWXNB/Vo1VXJ6ElRGOX0G3rJOC5dROlAMdO7HearZL4Q=; 7:46UNb0z8/OakO9ghhRRdRYEPPXOcFzRF076tWq9oK5NrUy0MqmMGwyTMWukPigbKE2tzW9i3mpwh+KptdHEt8YVOr+5OjlQP6lYnBVhwRIh9OLFhWQNqyS2eMWLtR71iWKqkP1sZ3kBwhly/04hBp4LE+jvgYxDr7r26bAzYunhbnnUoiJ6kTGjKi3DWm7SkgUkp0rDxG4pp5xSMLj50OKltFtC7mAuiLCzooyOC/t33/CVArZWCksD0r8Epf/3I SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2018 23:38:34.6797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a02ee292-2bc0-4f42-ab23-08d56f4d1208 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2850 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 They produce the value INT32_MIN not 0x80000000. This is sometimes OK if it is casted appropriately but leaves a subtle trap to the user. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky --- providers/mlx4/mlx4dv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/mlx4/mlx4dv.h b/providers/mlx4/mlx4dv.h index d47d3cd2e1f135..5312a866b6e281 100644 --- a/providers/mlx4/mlx4dv.h +++ b/providers/mlx4/mlx4dv.h @@ -288,12 +288,12 @@ enum { }; enum { - MLX4_WQE_BIND_TYPE_2 = (1<<31), + MLX4_WQE_BIND_TYPE_2 = (1UL<<31), MLX4_WQE_BIND_ZERO_BASED = (1<<30), }; enum { - MLX4_INLINE_SEG = 1 << 31, + MLX4_INLINE_SEG = 1UL << 31, MLX4_INLINE_ALIGN = 64, }; @@ -304,7 +304,7 @@ enum { enum { MLX4_WQE_MW_REMOTE_READ = 1 << 29, MLX4_WQE_MW_REMOTE_WRITE = 1 << 30, - MLX4_WQE_MW_ATOMIC = 1 << 31 + MLX4_WQE_MW_ATOMIC = 1UL << 31 }; struct mlx4_wqe_local_inval_seg {