From nobody Mon Feb 9 13:05:34 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 16872589221591005.6933262705367; Tue, 20 Jun 2023 04:02:02 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.551544.861171 (Exim 4.92) (envelope-from ) id 1qBZ73-0000G7-7H; Tue, 20 Jun 2023 11:01:29 +0000 Received: by outflank-mailman (output) from mailman id 551544.861171; Tue, 20 Jun 2023 11:01:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qBZ73-0000E6-0v; Tue, 20 Jun 2023 11:01:29 +0000 Received: by outflank-mailman (input) for mailman id 551544; Tue, 20 Jun 2023 10:35:27 +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 1qBYhr-0004Pq-I4 for xen-devel@lists.xenproject.org; Tue, 20 Jun 2023 10:35:27 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2b8d6657-0f56-11ee-b234-6b7b168915f2; Tue, 20 Jun 2023 12:35:26 +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 079F94EE0757; Tue, 20 Jun 2023 12:35:24 +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: 2b8d6657-0f56-11ee-b234-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Bertrand Marquis , Julien Grall , Michal Orzel , Xenia Ragiadakou , Ayan Kumar , Simone Ballarin Subject: [XEN PATCH 05/13] xen/common: fixed violations of MISRA C:2012 Rule 7.2 Date: Tue, 20 Jun 2023 12:34:57 +0200 Message-Id: <8aff4bc56b29372345e828462766d803b8c9b710.1687250177.git.gianluca.luparini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1687258922413100007 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. Signed-off-by: Simone Ballarin --- xen/common/device_tree.c | 4 ++-- xen/include/xen/libfdt/fdt.h | 2 +- xen/include/xen/libfdt/libfdt.h | 2 +- 3 files changed, 4 insertions(+), 4 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; diff --git a/xen/include/xen/libfdt/fdt.h b/xen/include/xen/libfdt/fdt.h index f2e68807f2..7c99d838e8 100644 --- a/xen/include/xen/libfdt/fdt.h +++ b/xen/include/xen/libfdt/fdt.h @@ -47,7 +47,7 @@ struct fdt_property { =20 #endif /* !__ASSEMBLY */ =20 -#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */ +#define FDT_MAGIC 0xd00dfeedU /* 4: version, 4: total size */ #define FDT_TAGSIZE sizeof(fdt32_t) =20 #define FDT_BEGIN_NODE 0x1 /* Start node: full name */ diff --git a/xen/include/xen/libfdt/libfdt.h b/xen/include/xen/libfdt/libfd= t.h index c71689e2be..dd6b649602 100644 --- a/xen/include/xen/libfdt/libfdt.h +++ b/xen/include/xen/libfdt/libfdt.h @@ -109,7 +109,7 @@ extern "C" { #define FDT_ERR_MAX 19 =20 /* constants */ -#define FDT_MAX_PHANDLE 0xfffffffe +#define FDT_MAX_PHANDLE 0xfffffffeU /* Valid values for phandles range from 1 to 2^32-2. */ =20 /**********************************************************************/ --=20 2.41.0