[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA C:2012 Rule 7.2


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 5 Jul 2023 16:28:55 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • 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=QzzK/XhWGOrk8HnjhJkj84yrN41q/XYrrsoE2vG07Tg=; b=PIGcKOG6fWHc4JcvZ6WgPHQW2bipPVA+D18zQ6Eupm4tOGNZNGHvXudtdOBNyto8PdRd1KgAQTYQC3TWqPoE3fsTs5x1JJS0ZmuRVaxtp7AZgcTtLU4a2XftzRyXhJG8glrC/dQ9d0oGqDVb4zqV7Zx81UXGp0FYKioFX/OspzQad9OcEkm/GkHeTd0NL9TX5cqV6zJVA4fv1JLgn1AqaqIzZSjIYSID4wMy39llR3wR8ou4bw9GZJMa2SWTY9FmQU9QB4dFhUYgGkvfJnYU9VdjDj+FF/MPHsIVULyRkeD6tEvN9haboYM76TbNPkyjUcVsJsrgcNztPmwPm1XO+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=muJWuD8CyC3HZNOXpSa2go82nU+ej+0FcMU8oiAQxmGWZXooB2nN7aBvAFt8tBOjmgl8RRxm+hr17wVX6JBmYAr04D/nypoe1UcCQWJzbzxuWEIy5vU10m80HuyJ6nUoqrKso6JrdtVC/3CAiWCBt73uMEbYSskdCeB5DcgQZtopxJArw5th/lW/N5RFMbUnVbNRIK+O3aMYRem98HhPHSpLnma54q5Yh6P+fy6O+2cNKBjQ1eRMia0vEdy23zQYUIPmM5J2WctAk2POVILoirjR6LGZycJ5ioQMCKiPe6x3lVDF9OmblFnLOP1IUCDgBCzn6csUO4rq7MyEZSt0fA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Xenia Ragiadakou <Xenia.Ragiadakou@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Wed, 05 Jul 2023 16:29:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZr1U/ZRs2G60btUij4+Ecgr80f6+rXN6A
  • Thread-topic: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA C:2012 Rule 7.2


> On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@xxxxxxxxxxx> wrote:
> 
> From: Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>
> 
> 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 <simone.ballarin@xxxxxxxxxxx>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>

Looks good to me

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>

> ---
> 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 = (unsigned long)_xmalloc (size + 4, __alignof__(struct 
> dt_device_node));
> 
> -    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
> +    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeefU);
> 
>     dt_dprintk("  unflattening %lx...\n", mem);
> 
> @@ -2125,7 +2125,7 @@ static void __init __unflatten_device_tree(const void 
> *fdt,
>     if ( be32_to_cpup((__be32 *)start) != FDT_END )
>         printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
>                   *((u32 *)start));
> -    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef )
> +    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeefU )
>         printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
>                   be32_to_cpu(((__be32 *)mem)[size / 4]));
>     *allnextp = NULL;
> -- 
> 2.41.0
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.