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

Re: [XEN PATCH 3/7] xen/arm: address MISRA C:2012 Rule 2.1



Hi,

On 11/12/2023 10:30, Nicola Vetrini wrote:
The "return 1;" statements at the end of some cases in the switch
of function 'vgic_v3_its_mmio_write' in 'vcig-v3-its.c' cause the
unreachability of the "return 1;" statement after the switch, thus
violating MISRA C:2012 Rule 2.1:
"A project shall not contain unreachable code".

The same is true for the switch in 'arch_memory_op' from
'xen/arch/arm/mm.c'.

For both cases, I actually much prefer the "return" version in the cases. In particular for the vGIC emulation the switch is quite large and it would not be trivial to know what happens after the break.

IOW, I would much prefer if we remove the "return ..." outside of the switch.

Cheers,

--
Julien Grall



 


Rackspace

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