From: Jan Beulich <jbeulich@suse.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: consulting@bugseng.com,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 2/7] x86/mm: address MISRA C:2012 Rule 2.1
Date: Tue, 19 Dec 2023 11:56:05 +0100 [thread overview]
Message-ID: <000ee2b2-9010-4c43-94de-1c8ea2bd8a61@suse.com> (raw)
In-Reply-To: <1cd82cf19a613a122a770bf6670e681ca7fccd44.1702891792.git.nicola.vetrini@bugseng.com>
On 18.12.2023 11:17, Nicola Vetrini wrote:
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -4887,8 +4887,6 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
> default:
> return subarch_memory_op(cmd, arg);
> }
> -
> - return 0;
> }
When a function is small and it's easy to see that all paths return by
other means, omitting such a final "return <value>" is imo okay. Here,
however, this isn't easy to see, and hence omitting the return is
confusing in a different way from having the return. I guess I'll make
an alternative change (as iirc I had outlined before), for other x86
maintainers to at least consider. The other alternative (causing less
code churn) would imo be to pull out the default case from the switch().
Jan
next prev parent reply other threads:[~2023-12-19 10:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 10:17 [XEN PATCH v2 0/7] address violations of MISRA C:2012 Rule 2.1 Nicola Vetrini
2023-12-18 10:17 ` [XEN PATCH v2 1/7] xen/shutdown: address " Nicola Vetrini
2023-12-19 1:31 ` Stefano Stabellini
2023-12-18 10:17 ` [XEN PATCH v2 2/7] x86/mm: " Nicola Vetrini
2023-12-19 1:33 ` Stefano Stabellini
2023-12-19 10:56 ` Jan Beulich [this message]
2023-12-18 10:17 ` [XEN PATCH v2 3/7] xen/arm: " Nicola Vetrini
2023-12-19 1:35 ` Stefano Stabellini
2023-12-18 10:17 ` [XEN PATCH v2 4/7] xen/arm: traps: add ASSERT_UNREACHABLE() where needed Nicola Vetrini
2023-12-19 1:36 ` Stefano Stabellini
2023-12-18 10:17 ` [XEN PATCH v2 5/7] x86/platform: removed break to address MISRA C:2012 Rule 2.1 Nicola Vetrini
2023-12-19 1:37 ` Stefano Stabellini
2023-12-18 10:17 ` [XEN PATCH v2 6/7] xen/arm: vcpreg: address violation of MISRA C " Nicola Vetrini
2023-12-19 1:39 ` Stefano Stabellini
2023-12-18 10:17 ` [XEN PATCH v2 7/7] automation/eclair_analysis: avoid violation of MISRA " Nicola Vetrini
2023-12-19 1:40 ` Stefano Stabellini
2023-12-19 1:43 ` Stefano Stabellini
2023-12-19 8:00 ` Nicola Vetrini
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=000ee2b2-9010-4c43-94de-1c8ea2bd8a61@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=consulting@bugseng.com \
--cc=nicola.vetrini@bugseng.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--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.