All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, jbeulich@suse.com,
	roger.pau@citrix.com, Bertrand.Marquis@arm.com,
	George.Dunlap@citrix.com,
	Stefano Stabellini <stefano.stabellini@xilinx.com>
Subject: Re: [PATCH 1/2] docs/misra: introduce rules.rst
Date: Wed, 25 May 2022 08:39:18 +0100	[thread overview]
Message-ID: <a19d22ca-33ef-b348-ac88-490010464bad@xen.org> (raw)
In-Reply-To: <20220525003505.304617-1-sstabellini@kernel.org>

Hi Stefano,

On 25/05/2022 01:35, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xilinx.com>
> 
> Introduce a list of MISRA C rules that apply to the Xen hypervisor. The
> list is in RST format.
> 
> Add a mention of the new list to CODING_STYLE.
> 
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>

NIT: I was under the impression that the first Signed-off-by is usually 
author. But the From doesn't match.

> ---
>   CODING_STYLE         |  6 ++++
>   docs/misra/rules.rst | 65 ++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 71 insertions(+)
>   create mode 100644 docs/misra/rules.rst
> 
> diff --git a/CODING_STYLE b/CODING_STYLE
> index 9f50d9cec4..1ef35ee8d0 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -235,3 +235,9 @@ callstack between the initial function call and the failure, no error
>   is returned.  Using domain_crash() requires careful inspection and
>   documentation of the code to make sure all callers at the stack handle
>   a newly-dead domain gracefully.
> +
> +MISRA C
> +-------
> +
> +The Xen Project hypervisor follows the MISRA C coding rules and
> +directives listed under docs/misra/rules.rst.
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> new file mode 100644
> index 0000000000..c0ee58ab25
> --- /dev/null
> +++ b/docs/misra/rules.rst
> @@ -0,0 +1,65 @@
> +=====================
> +MISRA C rules for Xen
> +=====================
> +
> +**IMPORTANT** All MISRA C rules, text, and examples are copyrighted by the
> +MISRA Consortium Limited and used with permission.
> +
> +Please refer to https://www.misra.org.uk/ to obtain a copy of MISRA C, or for
> +licensing options for other use of the rules.
> +
> +The following is the list of MISRA C rules that apply to the Xen Project
> +hypervisor.
I was under the impression that we would still allow deviations on those 
rules in some cases. In particular...

> +
> +- Rule: Dir 2.1
> +  - Severity:  Required
> +  - Summary:  All source files shall compile without any compilation errors
> +  - Link:  https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_02_01.c
> +- Rule: Dir 4.7
> +  - Severity:  Required
> +  - Summary:  If a function returns error information then that error information shall be tested
> +  - Link:  https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_04_07.c


... this one. We are using (void) + a comment when the return is ignored 
on purpose. This is technically not-compliant with MISRA but the best we 
can do in some situation.

With your proposed wording, we would technically have to remove them (or 
not introduce new one). So I think we need to document that we are 
allowing deviations so long they are commented.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2022-05-25  7:39 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  0:34 [PATCH 0/2] introduce docs/misra/rules.rst Stefano Stabellini
2022-05-25  0:35 ` [PATCH 1/2] docs/misra: introduce rules.rst Stefano Stabellini
2022-05-25  7:39   ` Julien Grall [this message]
2022-05-26  1:02     ` Stefano Stabellini
2022-05-26  9:43       ` Jan Beulich
2022-05-26  9:54         ` Bertrand Marquis
2022-05-26 10:15           ` Jan Beulich
2022-05-26 13:04             ` Bertrand Marquis
2022-05-26 19:57               ` Stefano Stabellini
2022-05-27  6:56                 ` Jan Beulich
2022-05-27 23:16                   ` Stefano Stabellini
2022-05-30  8:37                     ` Jan Beulich
2022-05-30  9:12                     ` Julien Grall
2022-05-30  9:16                       ` Jan Beulich
2022-05-30  9:27                         ` Julien Grall
2022-05-30  9:33                           ` Jan Beulich
2022-05-30  9:41                             ` Julien Grall
2022-05-30  9:55                               ` Jan Beulich
2022-05-30 10:21                                 ` George Dunlap
2022-05-30 13:35                                   ` Bertrand Marquis
2022-05-31  9:41                                     ` Julien Grall
2022-06-01  1:25                                       ` Stefano Stabellini
2022-05-25  8:25   ` Jan Beulich
2022-05-26  1:12     ` Stefano Stabellini
2022-05-26  9:36       ` Jan Beulich
2022-05-26 19:57         ` Stefano Stabellini
2022-05-25 12:21   ` Andrew Cooper
2022-05-26  1:57     ` Stefano Stabellini
2022-05-25  0:35 ` [PATCH 2/2] docs/misra: add Rule 5.1 Stefano Stabellini
2022-05-25  7:40   ` Julien Grall
2022-05-25 12:26     ` Andrew Cooper
2022-05-25  8:08   ` Jan Beulich
2022-05-26  1:18     ` Stefano Stabellini
2022-05-26  9:40       ` Jan Beulich
2022-05-26 10:10         ` Bertrand Marquis
2022-05-26 19:58         ` Stefano Stabellini

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=a19d22ca-33ef-b348-ac88-490010464bad@xen.org \
    --to=julien@xen.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=George.Dunlap@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --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.