All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
	 Gianluca Luparini <gianluca.luparini@bugseng.com>,
	 Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	 Michal Orzel <michal.orzel@amd.com>,
	 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 5 Jul 2023 16:32:40 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2307051632260.761183@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> 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@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> 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
> 


  parent reply	other threads:[~2023-07-05 23:33 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 15:26 [XEN PATCH v2 00/13] xen: fix violations of MISRA C:2012 Rule 7.2 Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 01/13] x86/cpufreq: " Simone Ballarin
2023-07-05 23:29   ` Stefano Stabellini
2023-07-06  7:44     ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 02/13] AMD/IOMMU: " Simone Ballarin
2023-07-05 23:31   ` Stefano Stabellini
2023-07-06  7:48     ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 03/13] x86/svm: " Simone Ballarin
2023-07-06  7:52   ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 04/13] xen/arm: " Simone Ballarin
2023-07-05 16:27   ` Luca Fancellu
2023-07-05 16:42     ` Julien Grall
2023-07-05 15:26 ` [XEN PATCH v2 05/13] xen/device-tree: " Simone Ballarin
2023-07-05 16:28   ` Luca Fancellu
2023-07-05 23:32   ` Stefano Stabellini [this message]
2023-07-06  8:01   ` Julien Grall
2023-07-05 15:26 ` [XEN PATCH v2 06/13] xen/efi: " Simone Ballarin
2023-07-05 16:34   ` Luca Fancellu
2023-07-05 23:37   ` Stefano Stabellini
2023-07-06  7:55     ` Jan Beulich
2023-07-06 22:14       ` Stefano Stabellini
2023-07-05 15:26 ` [XEN PATCH v2 07/13] x86/vmx: " Simone Ballarin
2023-07-05 23:39   ` Stefano Stabellini
2023-07-06  8:04   ` Jan Beulich
2023-07-06 22:17     ` Stefano Stabellini
2023-07-07  6:44       ` Jan Beulich
2023-07-07  8:18     ` Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 08/13] xen/pci: " Simone Ballarin
2023-07-06  8:05   ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 09/13] xen/public: " Simone Ballarin
2023-07-05 15:33   ` Juergen Gross
2023-07-06  7:43     ` Jan Beulich
2023-07-06  7:57       ` Juergen Gross
2023-07-06  8:43         ` Jan Beulich
2023-07-06  9:10           ` Juergen Gross
2023-07-05 23:42   ` Stefano Stabellini
2023-07-05 15:26 ` [XEN PATCH v2 10/13] x86/monitor: " Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 11/13] xen/vpci: " Simone Ballarin
2023-07-06  8:07   ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 12/13] xen/x86: " Simone Ballarin
2023-07-06  0:11   ` Stefano Stabellini
2023-07-06  8:26   ` Jan Beulich
2023-07-06 16:08     ` Simone Ballarin
2023-07-06 16:22       ` Jan Beulich
2023-07-07  6:50         ` Simone Ballarin
2023-07-07  7:04           ` Jan Beulich
2023-07-07  8:04             ` Simone Ballarin
2023-07-07  9:46               ` Jan Beulich
2023-07-07 21:53                 ` Stefano Stabellini
2023-07-10 16:09                   ` Simone Ballarin
2023-07-06 16:22       ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 13/13] xen: " Simone Ballarin
2023-07-05 16:43   ` Luca Fancellu
2023-07-05 18:42     ` Simone Ballarin
2023-07-05 19:32       ` Simone Ballarin
2023-07-06  8:28         ` Jan Beulich
2023-07-05 23:49   ` Stefano Stabellini
2023-07-06  8:34     ` Jan Beulich
2023-07-06  8:40   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2307051632260.761183@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=Xenia.Ragiadakou@amd.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=consulting@bugseng.com \
    --cc=gianluca.luparini@bugseng.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=simone.ballarin@bugseng.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.