xen/device-tree: fix violations of MISRA C:2012 Rule 7.2

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 <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Gianluca Luparini authored and Jan Beulich committed 2023-07-12 13:29:04 +02:00
1 parent 82d3665d65
commit 4efde79938
1 file changed
+2 -2
+2 -2
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.