From nobody Mon Feb 9 16:54:06 2026 Delivered-To: importer@patchew.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; Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 168725892495937.75312999411983; Tue, 20 Jun 2023 04:02:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.551557.861223 (Exim 4.92) (envelope-from ) id 1qBZ76-0001MN-N6; Tue, 20 Jun 2023 11:01:32 +0000 Received: by outflank-mailman (output) from mailman id 551557.861223; Tue, 20 Jun 2023 11:01:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qBZ76-0001Hz-5A; Tue, 20 Jun 2023 11:01:32 +0000 Received: by outflank-mailman (input) for mailman id 551557; Tue, 20 Jun 2023 10:35:40 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qBYi4-0004Ou-SI for xen-devel@lists.xenproject.org; Tue, 20 Jun 2023 10:35:40 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3099a977-0f56-11ee-8611-37d641c3527e; Tue, 20 Jun 2023 12:35:35 +0200 (CEST) Received: from beta.bugseng.com (93-40-74-174.ip37.fastwebnet.it [93.40.74.174]) by support.bugseng.com (Postfix) with ESMTPSA id AE2424EE0753; Tue, 20 Jun 2023 12:35:33 +0200 (CEST) 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: 3099a977-0f56-11ee-8611-37d641c3527e From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Stefano Stabellini , Michal Orzel , Xenia Ragiadakou , Ayan Kumar , Simone Ballarin Subject: [XEN PATCH 10/13] xen/x86: fixed violations of MISRA C:2012 Rule 7.2 Date: Tue, 20 Jun 2023 12:35:02 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1687258927199100003 Content-Type: text/plain; charset="utf-8" From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline= states: "A "u" or "U" suffix shall be applied to all integer constants that are rep= resented in an unsigned type". I propose to use "U" as a suffix to explicitly state when an integer consta= nt is represented in an unsigned type. For homogeneity, I also added the "U" suffix in some cases that the tool di= dn't report as violations. Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini --- xen/arch/x86/monitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c index d4857faf8a..dc336c239a 100644 --- a/xen/arch/x86/monitor.c +++ b/xen/arch/x86/monitor.c @@ -48,17 +48,17 @@ static unsigned long *monitor_bitmap_for_msr(const stru= ct domain *d, u32 *msr) =20 switch ( *msr ) { - case 0 ... 0x1fff: + case 0 ... 0x1fffU: BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->low) * 8 <=3D 0x1f= ff); return d->arch.monitor.msr_bitmap->low; =20 - case 0x40000000 ... 0x40001fff: + case 0x40000000U ... 0x40001fffU: BUILD_BUG_ON( sizeof(d->arch.monitor.msr_bitmap->hypervisor) * 8 <=3D 0x1fff= ); *msr &=3D 0x1fff; return d->arch.monitor.msr_bitmap->hypervisor; =20 - case 0xc0000000 ... 0xc0001fff: + case 0xc0000000U ... 0xc0001fffU: BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->high) * 8 <=3D 0x1= fff); *msr &=3D 0x1fff; return d->arch.monitor.msr_bitmap->high; --=20 2.41.0