Message ID | 20180208224506.GA2462@ziepe.ca (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Leon Romanovsky |
Headers | show
Return-Path: <linux-rdma-owner@kernel.org> 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 B00E060247 for <patchwork-linux-rdma@patchwork.kernel.org>; Thu, 8 Feb 2018 22:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CCF422230 for <patchwork-linux-rdma@patchwork.kernel.org>; Thu, 8 Feb 2018 22:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9137D28792; Thu, 8 Feb 2018 22:45:19 +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 EA14227FE4 for <patchwork-linux-rdma@patchwork.kernel.org>; Thu, 8 Feb 2018 22:45:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbeBHWpR (ORCPT <rfc822;patchwork-linux-rdma@patchwork.kernel.org>); Thu, 8 Feb 2018 17:45:17 -0500 Received: from mail-he1eur01on0052.outbound.protection.outlook.com ([104.47.0.52]:18144 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750961AbeBHWpQ (ORCPT <rfc822;linux-rdma@vger.kernel.org>); Thu, 8 Feb 2018 17:45:16 -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=Lc1Dzdxa0epeK+wLfcu6PwTNp8OHbhmFndr/+IXfVcQ=; b=bsksezRerx4muE4X/GIUI+oKNkoMkLNbwx+xr1jLYWKXJjOu12s4mcZ3zjaW38eiWTzygeyXNhZDOs3zQXD72MSrcSpWndX0RennvweM/CNWRTFXwQCHTw8PSD6TAmj127zr15W+0F29D+6VDm3LJCVjpKIdOAEfb1yUZ8uffA8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (70.74.179.152) by AM4PR0501MB2849.eurprd05.prod.outlook.com (2603:10a6:200:5c::16) 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 22:45:13 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from <jgg@mellanox.com>) id 1ejuwE-0000e3-W0 for linux-rdma@vger.kernel.org; Thu, 08 Feb 2018 15:45:06 -0700 Date: Thu, 8 Feb 2018 15:45:06 -0700 From: Jason Gunthorpe <jgg@mellanox.com> To: linux-rdma@vger.kernel.org Subject: [PATCH rdma-core] Fix compiler warnings on PPC64 and others Message-ID: <20180208224506.GA2462@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: HE1PR07CA0015.eurprd07.prod.outlook.com (2603:10a6:7:67::25) To AM4PR0501MB2849.eurprd05.prod.outlook.com (2603:10a6:200:5c::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2824d157-bdff-4617-d973-08d56f459e34 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2849; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2849; 3:uYiRLgXymMywKwsZd24Rh7fiozVARdzge5D2b5YsdQIauynGlOEtGx2QTWgaHXLaV5+D0ay9wJITR8/oTFdefblhVCOY+2O4uQtO1D4f7z+pVztBnK3dRjlUcnO2fpu6GXjzLDwV4+PbFKK8B7sg/9i5bvatDFS+nq6xCOkW4DPTKwr2fMCEraRKWaqbj48vMneHONFmwt+y4Gy2guEo9XlvwB500+zzdnRc79AB2yDdCS9Tk4X/qZqCksWLdaJ7; 25:dlMIyXPuB1Q78slyRYBByDjSEEZ/NbgfUW2+WBUSO5X807wzYuBKDnO50fFpb86CKvyfRLY2cQunzyup9Ja5huOIdO58D0AVUrGaWO8VaT53slCALf5I5HVBZL1sNs8oq8jDF9iGasjMwDAp2eHmLWSdAxvhU+0x4xBkIi5JElq5OOa3hp8/U0cQWBo31hrNER1PzYPZE6u8h8vudXzNJoaXN31WjW98GSTtUtQjsQxeGDv1k47F1MDvmxUsvOFeBX34RrutpUf07LiSvvL+wIzQr0ysd+Tycy4+loY5viHAOY8gsiYtPUM7lBduU34ch01n/tCJk5pmDqj4sKj93w==; 31:IusxWXrvpa3pzGkrU9frZE01U8jyMtyI7nlPyqWOFp7unYz7T1vXO1F/PEG88H+fYrCwg3RDopvWaZEUbwTnQjT1no0G6x15oKgNAm9+FgstRJi7ws5nF9nqMxq2d5Cn4CoMw5690ccuF267I0mNeYwnSh4KZXzQRYMJzNdfdpdryOKKCzDXZl8reRD9cQlxMSFImzfiW3b0ljIBGauJE9VljsLU/Jlbf7NRtgqHvF4= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2849: X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2849; 20:8eOB4R3zhpL1dSj2c8MrIbCsVy/rHLavTyLhAkcvrIBsCpOp0PF1cX39VAo5PCwxTXt/Mu1EfIlg9L4HwvgQG80ThMLp3wQ+XxY9FPCi/Z4xGSIqcy1iAb8k9iKeNpp19nSEeM1aqoYJCY+z7iP8pBAzEEOnHHgVWlyE6llfTzRJ1prnKV3QdPHPO8rQLsOHl/wHCWUqMe2/EnQHGVQPcscO3iR8jAegZ8X0rYkNPU2gPEsyQuJVK88gRIyU4Gqjv5CnHPLKBaEGCii4pGw4M0HTEfHdDY38oOzb7yZl9L/NiSveazzkVpSp/B4AMsqyTS9RiGhqGGBm55YtpQ9utSL+fvq5cbXZBfIxc3OtV4x2Xvo/BW8Z5ivhJuIhm4Zx5UBnEAQYU/QpjwJFvIflZRL/AsCfkGJwBxv0Y1Sy5noxt3b9/Q2XigA17iYVqEnoNy1Ht2GWWaFtujnMm1iX/TrtLEDa3tr2MNU00psLDcHaE4ooFLS5/RfD9Uwud1Iq; 4:wzUSpUf/26kPADK3Wex7N5d2jyAuxP5WIcGfia2ko3LUqQVmgWocoKXzyBal5iRXVCKFdK70XJppI/AFN6/Xp1mKOdJPQ2Ft1Bf2g3sXpjwcEoXrzWev4n4z+HgJifcoK6f/Q1Olh/mhkJYOEP+CQHbWDM+ZhHqc+Zt/h+6m8R+X7MxX22bjXUY3Wii8wqo7Xc0M02vJnvensu2H8iTtDUrnQLIMBMG7uYEATWRrUBPTc5tBZSttBiYsxgbc4rZhINyM+WoCNtHvocXNyN4NZA== X-Microsoft-Antispam-PRVS: <AM4PR0501MB2849C7DE3D59890677A88582CFF30@AM4PR0501MB2849.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041288)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR0501MB2849; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2849; X-Forefront-PRVS: 0577AD41D6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(366004)(39860400002)(346002)(376002)(199004)(189003)(81166006)(83506002)(16586007)(8936002)(83796002)(122856001)(58126008)(50466002)(106356001)(57986006)(86362001)(2361001)(2351001)(68736007)(5660300001)(52116002)(6916009)(9686003)(47776003)(105586002)(97736004)(6116002)(478600001)(53936002)(36756003)(59450400001)(26005)(33656002)(33896004)(1076002)(8676002)(69596002)(386003)(316002)(7736002)(46656002)(305945005)(66066001)(2906002)(186003)(81156014)(23726003)(3846002)(9746002)(9786002)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2849; 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; AM4PR0501MB2849; 23:3MpJewYnVCRWU1ydUI71CLl+K8KwznJxfmPHCWs?= =?us-ascii?Q?yOeXTPzxlFD6sf/B5ME3aqVmmb3MPvkyNCZteonYIuv6F3g8GTGxpLLVko+K?= =?us-ascii?Q?g3Z0w7NSa1UW8niOqrF5PspiHtk2JMlZ92Es1OWJEUpnBIatzINX/JBazP+s?= =?us-ascii?Q?n1OAWM9zdQkDDfFG0e7qYP/iFuZnqZBTzBhKwtFS3YKrfIWtcCvaWAHg4QjJ?= =?us-ascii?Q?mkpZXjiBA6opSqozR4MAVW9s3MMl5XYWgMZ9vhrBKSLK6Ablc9vJAdTaLCeq?= =?us-ascii?Q?TKlO2FAsSREG85w7jEwXZZracbZ1SPkDTRdbR8UvC9x+Li/q6vn+wGZ9OUQs?= =?us-ascii?Q?kFQZz7YughCTPcFdQIQ1QmIYztFUcqzwW9vJXkyUYkrEFeFQxGQAKQYc9GY4?= =?us-ascii?Q?BnqAsI6MfORm+NY7E8sLCqJ/sL9atHeNrKy38OLjmxiZrTo8q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oft-Exchange-Diagnostics: 1; AM4PR0501MB2849; 6:52Bxn/67sQTgxPFpXWednuwWZ1h1l9w6nobr13T6DlOIQEYAj3x3AcL6fIEHJiOWkk/+UB/16qdBrYOLzX0vmXnmdgP0zId89a2v2r6ucv9FqXYQBNW3ZMq6jnRNURcNyc4wns4AbnUwliX8qfkmtayarA6byQ25aBRf3rG8TCAzm+PgmNXhoPSKIwbXI1ui+p1DqE/tXtPhys0I0H6UWhfxSYJMXn7Ila5sWEXqkXeMIKmDSJl18CAslB9YTngfzFjOV5qibSKJ28fWFaItVrDg0rqZrdTmtDxoBhzhnxb9LPIoHiBwjxfirsH1kO60K6nVqxtvDXDWy+A6DHxatIeW7HT3n7YnTtZqJyduhWk=; 5:8gRiFzAGOziYHTxC7YF8cEgWXQmVypycgbWe65xLo3uJ5v+HpdMHs7IXOjHXbEf0m44c8rA91/aEGQ14YSV8KYK+wkXfjIx1pwftuINz8D4QGv+tf5WAn3ehpbg6+uyjtcxBrBFUiM3/Blr8uFSN/MEvKDSGRz/2F6r5ltxRx0o=; 24:z9OKhIz+dT3Xle87g37tOaVkh0ZiSJZLLTqh3NLRm2z3vpY2dgpr8PANKRimjFEe1llWNWL8n7VF4mr7t7j24Koo9wZmaq/DMInCbvFtT5E=; 7:jFMmDpyt+VHJYWW422WKxkc3UcxnBX7gV9UDmlcgXzT+1GY+Vv+RR4kKva3xDjSP/Ox0nv7KfTt+FXSmbu35xSRok42YV795d4MR5vbLCQxKUVSAdR8fvGhTlSoWTzqIhSn2UKTaroATJNS5rSxeo5Y16DzNdF6lBUiK7Hmbn/NPRncVuRHX671Jix1rAd9ozOAbfqerb6aD0f79nCMn6eD1Tr7asH6YYHcjhsmYkG1ySZ1dAfoxXKWNZTOi1dmj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2018 22:45:13.8295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2824d157-bdff-4617-d973-08d56f459e34 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2849 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: <linux-rdma.vger.kernel.org> X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/CMakeLists.txt b/CMakeLists.txt index e63f4cf563677a..b08d3fd2cf4246 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,6 +250,20 @@ CHECK_C_SOURCE_COMPILES(" HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE FAIL_REGEX "warning") +# Linux __u64 is an unsigned long long +CHECK_C_SOURCE_COMPILES(" +#include <linux/types.h> + int main(int argc,const char *argv[]) { __u64 tmp = 0; unsigned long long *tmp2 = &tmp; return *tmp2; }" + HAVE_LONG_LONG_U64 + FAIL_REGEX "warning") + +if (NOT HAVE_LONG_LONG_U64) + # Modern Linux has switched to use ull in all cases, but to avoid disturbing + # userspace some platforms continued to use unsigned long by default. This + # define will cause kernel headers to consistently use unsigned long long + add_definitions("-D__SANE_USERSPACE_TYPES__") +endif() + # Provide a shim if C11 stdatomic.h is not supported. if (NOT HAVE_SPARSE) CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC)
We have places in our code that assume __u64 is unsigned long long, and in general this is the Linux kernel standard. However a few archs still use unsigned long by default and require a -D__SANE_USERSPACE_TYPES__ to get long long. Detect this and provide the define to eliminate compilation warnings. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+)