From nobody Wed Nov 27 12:59:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=kernel.org); dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=2; a=rsa-sha256; t=1695943972; cv=pass; d=zohomail.com; s=zohoarc; b=E5n5Rj0dbJmtZLIne2LvldAtkE2vAYz2RirCXYcYMUb2ArIpzDAy5MwDPyl5Axf6QDJ4r9Y6YsRaliThheTW5PsNubmFO2jUKihuH8pMBsvKP13Zkeb9dVn6To/5fiY3uFwzxg6XR8mWSaM8pbrEEFfDy3nF4jr42V4WU50uD7w= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695943972; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2HFekxmIWiGuxZhkHilRxFo21oGlCAbLTUeYT9BvpbU=; b=NxjVXtnbJg2KWHAX527fcRgSxD0XIvI403FoxUAKwjVwcTIzAp1OYwvbZlZuUKJ3Qt2V9/gKdFJOxWNrz98pUt5WzKokIRygAxAhChE4zIjWFDDyffFhlUb6bcj+NssqdoGz0rms84H8r1L6MGTMy8aHnz+vQxY/vYu/ZrozFCs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=kernel.org); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1695943972033584.6764451541375; Thu, 28 Sep 2023 16:32:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.610108.949375 (Exim 4.92) (envelope-from ) id 1qm0Ua-0001hX-GF; Thu, 28 Sep 2023 23:32:24 +0000 Received: by outflank-mailman (output) from mailman id 610108.949375; Thu, 28 Sep 2023 23:32:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qm0Ua-0001hQ-DS; Thu, 28 Sep 2023 23:32:24 +0000 Received: by outflank-mailman (input) for mailman id 610108; Thu, 28 Sep 2023 23:32:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qm0UZ-0001hK-FJ for xen-devel@lists.xenproject.org; Thu, 28 Sep 2023 23:32:23 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20606.outbound.protection.outlook.com [2a01:111:f400:fe5b::606]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 43c71bf1-5e57-11ee-878b-cb3800f73035; Fri, 29 Sep 2023 01:32:22 +0200 (CEST) Received: from BLAPR03CA0065.namprd03.prod.outlook.com (2603:10b6:208:329::10) by IA1PR12MB6140.namprd12.prod.outlook.com (2603:10b6:208:3e8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.23; Thu, 28 Sep 2023 23:32:15 +0000 Received: from BL6PEPF0001AB55.namprd02.prod.outlook.com (2603:10b6:208:329:cafe::87) by BLAPR03CA0065.outlook.office365.com (2603:10b6:208:329::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.25 via Frontend Transport; Thu, 28 Sep 2023 23:32:15 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by BL6PEPF0001AB55.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Thu, 28 Sep 2023 23:32:15 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 28 Sep 2023 18:32:14 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 28 Sep 2023 18:32:14 -0500 Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 28 Sep 2023 18:32:13 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 43c71bf1-5e57-11ee-878b-cb3800f73035 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UkzikMpcedhbHF1TiOZN3IIAu+SUOaJUJpOTbA3rbv5+RAllEkB8yk6CGHY+78dhTDJG24GAnl8yTzikBSn0QKF1aD9igg+EX0ZJyA4IiH5ejovsiM5I7WK72vQOlh//9vzEcHuw6yzF/Ew7R/mc0MrccySLdudfs9fRRxFVUnMeC80DpLocYa8VqSEVNh60hMM3LUsmNfxZZfjEWPVXWTIQ4NhF7JQsSiZJWJAivkP3v4aVahYJPLTxzCZEgT/P5tLH8vg4b201RKTshp51Kl0nnEWNuN2yDoNGtouT+s7EjJn+ItN7EGKH+GkdYO5qxPJjlhxJWH0FJXbC2e5BHg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2HFekxmIWiGuxZhkHilRxFo21oGlCAbLTUeYT9BvpbU=; b=YJaB+tbKt1K/3fKybJ9e1JN5EgBJmOJ8TCCVAdcqN4cMsjNPG6z8gwWHPiyUIFAY/W08/qGFAOpKMa63yQN0/ODOuR+nafR7NwNgfoszHjJLE9hEuPWjnQsf/UGyCOaeZgUzHwKRj8esDwWW//mmWRjq8Q9Wzc3tJ7nhNZqnR5WsDZ7cwklt0Cek3RLrPr8syu37Vx/F9z0p95DBC8Sf50OJmPuMZ0p+R6v4y8f4jgCwxhBDc+Kj/nkdMTXDM3O2gOpNh7MSFUPNxeTWe6FMVviX2yaHvh/UCAD/Ztk5p+P72GuSfw7ZooXTyJCeDORmd6iosknJpZcvaaAowV8K1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=kernel.org; dmarc=fail (p=none sp=none pct=100) action=none header.from=kernel.org; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2HFekxmIWiGuxZhkHilRxFo21oGlCAbLTUeYT9BvpbU=; b=ZVKTRljnYXOjf8WQfNozEgFGrTbvGEwCPhh6QYYN3ces5VWxh5Y29BzhtmrYPdKiw9h/lpypDOw1rE4Z2TrRSdqlgrWbB+krfwT0Vz7M6J1DyYxWFm6P7zJqVwcXfc6VkgWxmbn2WaqKSnjM9kZ8p3sE8mOw8PEOBmbsIO0SAS3VrqkTxRThLZdIPA1rWaTtSpCO3HFcMlcCW673oA7obvz0teccu/ookZ0Xn7Doi+nVbVwRNRRMlbUj5l8Xs1KUNGlDToImTi5YJbtBrLQCjR+kxyiV8NaBDK3R5EezhWNJD2A2PyHBNF0iaurWIbt1jmQeO4YpTx/eitVP9lPE6g== X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 165.204.84.17) smtp.mailfrom=kernel.org; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=kernel.org; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning kernel.org discourages use of 165.204.84.17 as permitted sender) Date: Thu, 28 Sep 2023 16:32:12 -0700 From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: CC: , , , , , , , Subject: [PATCH] cpumask: fix integer type in cpumask_first Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB55:EE_|IA1PR12MB6140:EE_ X-MS-Office365-Filtering-Correlation-Id: 8db9a137-869a-4515-43b8-08dbc07b2606 X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /saHeQVemjVhpkwFSVSyFeeavwrUIKWOQhHxoZwtPEmOSp8iryEJCWFN5nrWq643M/Vf8RhABEcox++AnE478ZlZ0EXlEgbBN9l1f3MfX9hA4XnWdisE6nIka1OPqJ3dpYBaq/sO23hl8jliSk7Kg+CRELsc7XoQy1RBCCv/6ynQVRxoGR6wfUrMdFi/d4S7JCboTPm1UJaztcl3xW4kcZM6+sYRfufwkTs3cgYW45Dh/nanTiWSHdiWOD3KLF5zZIfmOF/iM3h6abTrz+oHo/03qB2x8jUDKW6MyoqZxKqcNX9TJWDrDUkh33voI0bk2dibhH09vgoU3gYoiXh2oFxAsFRllk8rxR4fVg+JYSdYMjOble3HSYLQpU+tO6EHwzzuK1ZGn7Zrc88D3vjq5A8i57IrHVOubbx9IU7ImVcOf+X0ubSpH4rLj+f7Ab5zjLJ9VIRrvN+oxoDJr3O3fZDDG5Xwc7+iJRIDJVdXNt5KZDiMJ+haKoWakJDiih+qgRZzzR42+HdoEbuSXWr3cMz+B709Z8/xXykv3oqRO33m9ccUJetr97u8Y7zBqhciVqtpx7NlKYqM094GH6yrxzu0NDecwOC6WMdAk/rtoM8w0SlxEsseaRX2s1brZqV9AZ7U2L+tlxhDeChhKe1JNUgn7PHFgbLiXoSBsnwHdS7p5rtYVQxCxP/+Wgjg2NRabR8s0IJnvXcjGSRCbCXfYFy9/1KbDNrwkUyxO+NL06WWZt+LOTSlkhIqNUdW4ZIxIpzegD0vKctuCt+dfRAE5g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(7916004)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(82310400011)(61400799006)(48200799006)(64100799003)(451199024)(46966006)(40470700004)(47076005)(498600001)(35950700001)(40460700003)(26005)(336012)(82740400003)(40480700001)(9686003)(356005)(81166007)(86362001)(4744005)(2906002)(33716001)(8936002)(8676002)(4326008)(5660300002)(316002)(70586007)(70206006)(54906003)(6916009)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amdcloud.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 23:32:15.4043 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8db9a137-869a-4515-43b8-08dbc07b2606 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB55.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6140 X-ZohoMail-DKIM: pass (identity @amdcloud.onmicrosoft.com) X-ZM-MESSAGEID: 1695943974024100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nr_cpu_ids is unsigned int, but find_first_bit returns unsigned long (at least on arm). Use the larger type for min_t to avoid larger-to-smaller type assignments. This address 141 MISRA C 10.3 violations. Signed-off-by: Stefano Stabellini --- diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h index 9826707909..a6ed6a28e8 100644 --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -208,7 +208,7 @@ static inline void cpumask_copy(cpumask_t *dstp, const = cpumask_t *srcp) =20 static inline int cpumask_first(const cpumask_t *srcp) { - return min_t(int, nr_cpu_ids, find_first_bit(srcp->bits, nr_cpu_ids)); + return min_t(unsigned long, nr_cpu_ids, find_first_bit(srcp->bits, nr_cpu= _ids)); } =20 static inline int cpumask_next(int n, const cpumask_t *srcp)