From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8F08EB64DA for ; Wed, 5 Jul 2023 15:27:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.559317.874285 (Exim 4.92) (envelope-from ) id 1qH4Pf-0004Ej-MM; Wed, 05 Jul 2023 15:27:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 559317.874285; Wed, 05 Jul 2023 15:27:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qH4Pf-0004E6-HA; Wed, 05 Jul 2023 15:27:27 +0000 Received: by outflank-mailman (input) for mailman id 559317; Wed, 05 Jul 2023 15:27:25 +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 1qH4Pd-0001jW-MY for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:25 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 70dc1d4e-1b48-11ee-8611-37d641c3527e; Wed, 05 Jul 2023 17:27:24 +0200 (CEST) Received: from beta.bugseng.com (unknown [37.163.248.64]) by support.bugseng.com (Postfix) with ESMTPSA id CFD1E4EE0C9B; Wed, 5 Jul 2023 17:27:22 +0200 (CEST) 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: 70dc1d4e-1b48-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 Halder , Simone Ballarin Subject: [XEN PATCH v2 10/13] x86/monitor: fix violations of MISRA C:2012 Rule 7.2 Date: Wed, 5 Jul 2023 17:26:32 +0200 Message-Id: <8fd5ef2ace63cfd86e94aafb533a139f2a7d0f96.1688559115.git.gianluca.luparini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type and also to other literals used in the same contexts or near violations, when their positive nature is immediately clear. The latter changes are done for the sake of uniformity. Signed-off-by: Simone Ballarin Signed-off-by: Gianluca Luparini Reviewed-by: Stefano Stabellini --- Changes in v2: - change commit title to make it unique - change commit message --- 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 struct domain *d, u32 *msr) switch ( *msr ) { - case 0 ... 0x1fff: + case 0 ... 0x1fffU: BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->low) * 8 <= 0x1fff); return d->arch.monitor.msr_bitmap->low; - case 0x40000000 ... 0x40001fff: + case 0x40000000U ... 0x40001fffU: BUILD_BUG_ON( sizeof(d->arch.monitor.msr_bitmap->hypervisor) * 8 <= 0x1fff); *msr &= 0x1fff; return d->arch.monitor.msr_bitmap->hypervisor; - case 0xc0000000 ... 0xc0001fff: + case 0xc0000000U ... 0xc0001fffU: BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->high) * 8 <= 0x1fff); *msr &= 0x1fff; return d->arch.monitor.msr_bitmap->high; -- 2.41.0