From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
consulting@bugseng.com,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v3] x86: p2m-pod: address violation of MISRA C Rule 2.1
Date: Tue, 10 Dec 2024 14:10:33 +0100 [thread overview]
Message-ID: <7684e75d33c741c532a65014473e2f92@bugseng.com> (raw)
In-Reply-To: <b8680a05-1605-40ae-a3e6-e013525097cc@suse.com>
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
>> deliberately
>> unreachable, 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 avoids
>> considering the unconditional return at the end of the function as a
>> cause
>> of unreachability, while preserving the semantics of the function.
>>
>> No functional change intended.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 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)
prev parent reply other threads:[~2024-12-10 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 10:54 [XEN PATCH v3] x86: p2m-pod: address violation of MISRA C Rule 2.1 Nicola Vetrini
2024-12-10 12:43 ` Jan Beulich
2024-12-10 13:10 ` Nicola Vetrini [this message]
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=7684e75d33c741c532a65014473e2f92@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=consulting@bugseng.com \
--cc=jbeulich@suse.com \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/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.