From patchwork Mon Jul 15 10:35:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11043569 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 4DE646C5 for ; Mon, 15 Jul 2019 10:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37C3426E56 for ; Mon, 15 Jul 2019 10:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28B30262F2; Mon, 15 Jul 2019 10:37: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A928F262F2 for ; Mon, 15 Jul 2019 10:37:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hmyKR-0002c2-1D; Mon, 15 Jul 2019 10:35:31 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hmyKP-0002bx-ES for xen-devel@lists.xenproject.org; Mon, 15 Jul 2019 10:35:29 +0000 X-Inumbo-ID: 4292903f-a6ec-11e9-8980-bc764e045a96 Received: from m4a0041g.houston.softwaregrp.com (unknown [15.124.2.87]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 4292903f-a6ec-11e9-8980-bc764e045a96; Mon, 15 Jul 2019 10:35:27 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.146) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Mon, 15 Jul 2019 10:35:24 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 15 Jul 2019 10:35:12 +0000 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Mon, 15 Jul 2019 10:35:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G6QrRRHgVmpaHwR5a86HXqruDyMSSpPczLFDwENrSpvzFuDHvWlYwJU0QZWsbVtioMhHXwggiQ+eIcTG0vvIoTHWaAQoqtR1p0QmXwhxCNaYzNGDm7YjSlBe2d3rfO4S0xW2CIR/jmXPGXSQ50dWzqFHpARwElRkfAceOR05W7fEdL9wLLxRadzINjWKUbFELI5cjLnwYeY+292+O4dxE1oq/6Oi8eM3eir6LPSN/+7JG0PFfh6cgX4InSwdC+msr3nAeQfiR8qGpLnp1T/MQBU4BFBoJtLIxTWstTaArUVoOcNhq0TpWCdIPuuWAuK+aNUKcItR+dFJco9PsiZrkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P98ajWSvzMrYIlpir5/UWclTb2KKiKzTfhDaLdIkde8=; b=eSwvoj0EtTlbFCvq2TFHV96cngj5sHYzP4qNscs4ahIrWKIFLxYBG7ZdAkXqiBRNHozbPhaeJK302HLv0XuPUKxBknKKIEkmc7nwWYlvtLLSrNMELZO/mm9QibWOXkt3Vn6BntKpfhdZSpqS4cFQ60a5hKxyLKM3jA1ldueOxustyDzyWnyqOnLy1iQMMPtthhxOEWDHhUWRX/O3s4lYXm0OkzFZgMyH5Td8IWZLKH4fy4sJFlRqfD5l9UCSxtf+AlUeSPJv/v2JBzeMtxA6P5aDXPYPN6cH9fWNpRODeN9Q7VPgq9CUDRduPbSU1YVtR3mdtHUy4tsrnPffVYQsKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none Received: from DM6PR18MB3401.namprd18.prod.outlook.com (10.255.174.218) by DM6PR18MB3372.namprd18.prod.outlook.com (10.255.174.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Mon, 15 Jul 2019 10:35:11 +0000 Received: from DM6PR18MB3401.namprd18.prod.outlook.com ([fe80::1fe:35f6:faf3:78c7]) by DM6PR18MB3401.namprd18.prod.outlook.com ([fe80::1fe:35f6:faf3:78c7%7]) with mapi id 15.20.2073.012; Mon, 15 Jul 2019 10:35:11 +0000 From: Jan Beulich To: "xen-devel@lists.xenproject.org" Thread-Topic: [PATCH] x86/dom0-build: fix build with clang5 Thread-Index: AQHVOvj6+Q8sMST8H0euZPd/xzIlPw== Date: Mon, 15 Jul 2019 10:35:11 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-clientproxiedby: DB7PR08CA0009.eurprd08.prod.outlook.com (2603:10a6:5:16::22) To DM6PR18MB3401.namprd18.prod.outlook.com (2603:10b6:5:1cc::26) authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [87.234.252.170] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: af0482b8-dc8c-43fc-0796-08d709101d30 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(49563074)(7193020); SRVR:DM6PR18MB3372; x-ms-traffictypediagnostic: DM6PR18MB3372: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 00997889E7 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(376002)(136003)(396003)(366004)(346002)(39860400002)(199004)(189003)(486006)(81156014)(81166006)(54906003)(316002)(8936002)(3846002)(99936001)(31686004)(6436002)(6116002)(6486002)(2351001)(4326008)(99286004)(6916009)(5640700003)(53936002)(6512007)(5660300002)(71190400001)(71200400001)(86362001)(66446008)(64756008)(66556008)(66476007)(66616009)(66946007)(31696002)(52116002)(2906002)(2501003)(66066001)(80792005)(478600001)(36756003)(8676002)(26005)(305945005)(7736002)(25786009)(68736007)(476003)(2616005)(186003)(256004)(102836004)(14454004)(6506007)(386003)(14444005); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR18MB3372; H:DM6PR18MB3401.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 6ZM74Fkyd206ujM2lG0VCPFmromqwM3OBNAy9fsmmYGKa2CDLRsx/z+uAc3fV2rWDAdMRxY9sJRKWWPLNnvZYSSLVPTuJSquFCOhgomyUzHOVBM3lyKAgI2v8VpqMXGllGZ8RD5s6kruU/6e/qX5NxZJkc0yzMHhj9daZvW44xGg7Dstmw7ZpYbB+WiMwib7Y7/UTs3mh/mQzzD3Hv55WGTqjzOr6Ah2H+7QEo8qYW5vQ/jbuHp67Z4OsfmmSdYI/LUHHtptgayrSERFTUHaVdrQtnJb9oipXTAxA8n5dNt7E0yN0EqVTBZx1i6Tv+V+pSeYT2mJwC6s7m5R3jt9MsKuuPJBIZBgKCULoTGTW79dZRpS6XXsrmsyEuigMEkkbK+9WBP6Zw4Tp5nXYGNSFSyH23VRSQiIL6bQ93KDD7c= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: af0482b8-dc8c-43fc-0796-08d709101d30 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2019 10:35:11.0837 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JBeulich@suse.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3372 X-OriginatorOrg: suse.com Subject: [Xen-devel] [PATCH] x86/dom0-build: fix build with clang5 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP With non-empty CONFIG_DOM0_MEM clang5 produces dom0_build.c:344:24: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) ^ ~~~~~~~~~~~~~~~~~~ dom0_build.c:344:24: note: use '&' for a bitwise operation if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) ^~ & dom0_build.c:344:24: note: remove constant to silence this warning if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) ~^~~~~~~~~~~~~~~~~~~~~ 1 error generated. Obviously neither of the two suggestions are an option here. Oddly enough swapping the operands of the && helps, while e.g. casting or parenthesizing doesn't. Another workable variant looks to be the use of !! on the constant. Signed-off-by: Jan Beulich --- I'm open to going the !! or yet some different route. No matter which one we choose, I'm afraid it is going to remain guesswork what newer (and future) versions of clang will choke on. x86/dom0-build: fix build with clang5 With non-empty CONFIG_DOM0_MEM clang5 produces dom0_build.c:344:24: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) ^ ~~~~~~~~~~~~~~~~~~ dom0_build.c:344:24: note: use '&' for a bitwise operation if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) ^~ & dom0_build.c:344:24: note: remove constant to silence this warning if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) ~^~~~~~~~~~~~~~~~~~~~~ 1 error generated. Obviously neither of the two suggestions are an option here. Oddly enough swapping the operands of the && helps, while e.g. casting or parenthesizing doesn't. Another workable variant looks to be the use of !! on the constant. Signed-off-by: Jan Beulich --- I'm open to going the !! or yet some different route. No matter which one we choose, I'm afraid it is going to remain guesswork what newer (and future) versions of clang will choke on. --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -341,7 +341,7 @@ unsigned long __init dom0_compute_nr_pag unsigned long avail = 0, nr_pages, min_pages, max_pages; bool need_paging; - if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) + if ( CONFIG_DOM0_MEM[0] && !dom0_mem_set ) parse_dom0_mem(CONFIG_DOM0_MEM); for_each_node_mask ( node, dom0_nodes ) --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -341,7 +341,7 @@ unsigned long __init dom0_compute_nr_pag unsigned long avail = 0, nr_pages, min_pages, max_pages; bool need_paging; - if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) + if ( CONFIG_DOM0_MEM[0] && !dom0_mem_set ) parse_dom0_mem(CONFIG_DOM0_MEM); for_each_node_mask ( node, dom0_nodes )