diff mbox series

[XEN,v5,13/17] xen: add deviations for MISRA C 2012 Dir D4.10

Message ID 1a47750ebed47a3429269112fad6da58bfb6ee96.1721720583.git.alessandro.zucchelli@bugseng.com (mailing list archive)
State New
Headers show
Series xen: address violation of MISRA C:2012 Directive 4.10 | expand

Commit Message

Alessandro Zucchelli July 23, 2024, 8:15 a.m. UTC
From: Nicola Vetrini <nicola.vetrini@bugseng.com>

Add safe deviation for *.c files, as estabilished in past discussion.

Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

---
Changes in v4:
- split the commit from the unrelated SAF deviation
Commit introduced in v3

Link to the discussion thread:
https://lists.xenproject.org/archives/html/xen-devel/2023-09/msg00239.html
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 docs/misra/deviations.rst                        | 6 ++++++
 2 files changed, 11 insertions(+)

Comments

Jan Beulich July 30, 2024, 9:45 a.m. UTC | #1
On 23.07.2024 10:15, Alessandro Zucchelli wrote:
> From: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Add safe deviation for *.c files, as estabilished in past discussion.
> 
> Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
> Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Hmm, I was about to commit this when I noticed the mismatch between From:
and the sequence of S-o-b: Who's properly the original author of this
patch (whose S-o-b ought to be first)?

Jan
Nicola Vetrini July 30, 2024, 9:54 a.m. UTC | #2
On 2024-07-30 11:45, Jan Beulich wrote:
> On 23.07.2024 10:15, Alessandro Zucchelli wrote:
>> From: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> 
>> Add safe deviation for *.c files, as estabilished in past discussion.
>> 
>> Signed-off-by: Maria Celeste Cesario  
>> <maria.celeste.cesario@bugseng.com>
>> Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Hmm, I was about to commit this when I noticed the mismatch between 
> From:
> and the sequence of S-o-b: Who's properly the original author of this
> patch (whose S-o-b ought to be first)?
> 
> Jan

Hi,

the original authors are Maria Celeste Cesario and Simone Ballarin, then 
me and Alessandro picked this up.
Perhaps some git configuration made it so that my From is there, but the 
S-o-b order reflects the ordering of events.

Thanks,
  Nicola
diff mbox series

Patch

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 1c39a9a16d..c6b1a10bcf 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -78,6 +78,11 @@  conform to the directive."
 -config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"}
 -doc_end
 
+-doc_begin="Including multiple times a .c file is safe because every function or data item
+it defines would (in the common case) be already defined. Peer reviewed by the community."
+-config=MC3R1.D4.10,reports+={safe, "all_area(all_loc(^.*\\.c$))"}
+-doc_end
+
 #
 # Series 5.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 1ecce1469a..d51aa422b5 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -30,6 +30,12 @@  Deviations related to MISRA C:2012 Directives:
        not to add an additional encapsulation layer.
      - Tagged as `deliberate` for ECLAIR.
 
+   * - D4.10
+     - Including multiple times a .c file is safe because every function or data item
+       it defines would in (the common case) be already defined.
+       Peer reviewed by the community.
+     - Tagged as `safe` for ECLAIR.
+
 Deviations related to MISRA C:2012 Rules:
 -----------------------------------------