[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH v3] x86: p2m-pod: address violation of MISRA C Rule 2.1
On 2024-12-10 13:43, Jan Beulich wrote: On 10.12.2024 11:54, Nicola Vetrini wrote:Rule 2.1 states: "A project shall not contain unreachable code". The placement of the loop after "out_unmap" can be moved earlier in order to avoid the unconditional return to be marked as a cause of unreachability for the loop, as this is a consequence of"__builtin_unreachable" being configured in ECLAIR as being deliberatelyunreachable, and therefore not reported as causing the code after the "out_unmap" label to be unreachable. Replacing one instance of "goto out_unmap" with the loop avoidsconsidering the unconditional return at the end of the function as a causeof unreachability, while preserving the semantics of the function. No functional change intended. Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> with ... Thanks --- a/xen/arch/x86/mm/p2m-pod.c +++ b/xen/arch/x86/mm/p2m-pod.c@@ -1005,7 +1005,14 @@ p2m_pod_zero_check(struct p2m_domain *p2m, const gfn_t *gfns, unsigned int count{ ASSERT_UNREACHABLE(); domain_crash(d); - goto out_unmap; +out_unmap:... the label indented by one or more blanks, as per ./CODING_STYLE. Happy to adjust while committing. Right, I followed the style used in this file assuming that it was in line with CODING_STYLE, but I now see that this is not the case. No problem either way. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |