From nobody Mon Feb 9 15:28:46 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 1689158060317677.346533881774; Wed, 12 Jul 2023 03:34:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.562206.878838 (Exim 4.92) (envelope-from ) id 1qJXAR-0007Fm-BY; Wed, 12 Jul 2023 10:33:55 +0000 Received: by outflank-mailman (output) from mailman id 562206.878838; Wed, 12 Jul 2023 10:33:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qJXAQ-0007De-V9; Wed, 12 Jul 2023 10:33:54 +0000 Received: by outflank-mailman (input) for mailman id 562206; Wed, 12 Jul 2023 10:33:54 +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 1qJXAQ-00061z-10 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:54 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9831a288-209f-11ee-8611-37d641c3527e; Wed, 12 Jul 2023 12:33:52 +0200 (CEST) Received: from beta.bugseng.com (unknown [37.161.151.90]) by support.bugseng.com (Postfix) with ESMTPSA id F0ED54EE0C8D; Wed, 12 Jul 2023 12:33:50 +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: 9831a288-209f-11ee-8611-37d641c3527e From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Stefano Stabellini , Julien Grall , Michal Orzel , Xenia Ragiadakou , Ayan Kumar Halder , Simone Ballarin , Luca Fancellu Subject: [XEN PATCH v3 05/15] xen/device-tree: fix violations of MISRA C:2012 Rule 7.2 Date: Wed, 12 Jul 2023 12:32:06 +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: 1689158060998100005 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 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: Gianluca Luparini Signed-off-by: Simone Ballarin Reviewed-by: Luca Fancellu Reviewed-by: Stefano Stabellini --- Changes in v3: - change 'Signed-off-by' ordering Changes in v2: - change commit title to the right one - change commit message - change maintainers in Cc - remove changes in 'libfdt' --- xen/common/device_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 8da1052911..0677193ab3 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -2115,7 +2115,7 @@ static void __init __unflatten_device_tree(const void= *fdt, /* Allocate memory for the expanded device tree */ mem =3D (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_devic= e_node)); =20 - ((__be32 *)mem)[size / 4] =3D cpu_to_be32(0xdeadbeef); + ((__be32 *)mem)[size / 4] =3D cpu_to_be32(0xdeadbeefU); =20 dt_dprintk(" unflattening %lx...\n", mem); =20 @@ -2125,7 +2125,7 @@ static void __init __unflatten_device_tree(const void= *fdt, if ( be32_to_cpup((__be32 *)start) !=3D FDT_END ) printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n", *((u32 *)start)); - if ( be32_to_cpu(((__be32 *)mem)[size / 4]) !=3D 0xdeadbeef ) + if ( be32_to_cpu(((__be32 *)mem)[size / 4]) !=3D 0xdeadbeefU ) printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n", be32_to_cpu(((__be32 *)mem)[size / 4])); *allnextp =3D NULL; --=20 2.41.0