Refactor the code to avoid an implicit fallthrough and address
a violation of MISRA C:2012 Rule 16.3: "An unconditional `break'
statement shall terminate every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
Changes in v2:
- improved description.
-
gh keyword
that is not defined in x86-emulate.h at the moment).
Federico Serafini (4):
x86/emul: add defensive code
x86/emul: address violations of MISRA C Rule 16.3
xen/vpci: address violations of MISRA C Rule 16.3
xen/pci: address a violation of MISRA C Rule 16.3
xen/arch/x86/x8
Add missing break statements to address violations of MISRA C:2012
Rule 16.3 (An unconditional `break' statement shall terminate
every switch-clause).
Make explicit unreachability of a program points with
ASSERT_UNREACHABLE().
No functional change.
Signed-off-by: Federico Serafini
---
Ch
Address violations of MISRA C:2012 Rule 16.3:
"An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
Changes from v2:
- simply break without returning X86EMUL_UNHANDLEABLE.
As pointed out by Jan, these
Add defensive code after unreachable program points.
This also meets the requirements to deviate violations of MISRA C:2012
Rule 16.3: "An unconditional `break' statement shall terminate every
switch-clause".
Signed-off-by: Federico Serafini
---
Changes in v2:
- use goto unhandl
Add missing break statements to address violations of MISRA C:2012
Rule 16.3 (An unconditional `break' statement shall terminate
every switch-clause).
Make explicit unreachability of a program point with
ASSERT_UNREACHABLE() and add defensive code.
No functional change.
Signed-off-by: Fed
Add Rule 11.2 and Rule 18.1 to the monitored set.
Tag Rule 7.3 as clean.
Tag Rule 11.2 and Rule 20.7 as clean only for arm.
Rule 2.2, Rule 9.5 and Directive 4.12 are not accepted:
do not enable them and do not tag them as clean.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis
witch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
No changes from v1.
---
xen/arch/x86/x86_emulate/decode.c | 6 --
xen/arch/x86/x86_emulate/x86_emulate.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/x86_emulate/decode.c
Tag MISRA C:2012 Rule 16.3 as clean for both architectures:
new violations will cause a failure of the CI/CD pipeline.
Signed-off-by: Federico Serafini
---
No changes from v1.
---
automation/eclair_analysis/ECLAIR/tagging.ecl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a
Define pseudo keyword fallthrough for the x86 emulator,
use it and tag the rule as clean.
Federico Serafini (3):
x86/emul: auxiliary definition of pseudo keyword fallthrough
x86/emul: use pseudo keyword fallthrough
automation/eclair: tag Rule 16.3 as clean
automation/eclair_analysis
On 13/11/24 10:57, Jan Beulich wrote:
On 13.11.2024 09:17, Federico Serafini wrote:
Tag MISRA C:2012 Rule 16.3 as clean for both architectures:
new violations will cause a failure of the CI/CD pipeline.
Signed-off-by: Federico Serafini
---
No changes from v1.
---
automation/eclair_analysis
and fuzzing harness without iterfearing with the one
that the Xen build has.
Signed-off-by: Federico Serafini
---
Changes from v1:
- moved definition in the right file;
- remove useless parenthesis;
- description improved.
---
tools/tests/x86_emulator/x86-emulate.h | 10 ++
1 file
On 06/11/24 12:22, Jan Beulich wrote:
On 06.11.2024 10:04, Federico Serafini wrote:
The pseudo keyword fallthrough shall be used to make explicit the
fallthrough intention at the end of a case statement (doing this
through comments is deprecated).
Signed-off-by: Federico Serafini
---
xen
sions mentioned above violates
MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not
contain any expression which has potential side effect).
Refactor the code to address the rule violation.
Suggested-by: Andrew Cooper
Signed-off-by: Federico Serafini
---
Changes in v2:
- better d
above violates
MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not
contain any expression which has potential side effect).
Refactor the code to address the rule violation.
Suggested-by: Andrew Cooper
Signed-off-by: Federico Serafini
---
Changes in v2:
- better d
Update ECLAIR configuration to consider Rule 13.6 as clean:
new violations of this rule will cause a failure of the CI pipeline.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/tagging.ecl | 1 +
1 file changed, 1 insertion(+)
diff --git a/automation/eclair_analysis
Address remaining violations of Rule 13.6 and tag it as clean.
Federico Serafini (3):
EFI: address violations of MISRA C Rule 13.6
xen/gnttab: address violations of MISRA C Rule 13.6
automation/eclair: tag Rule 13.6 as clean
automation/eclair_analysis/ECLAIR/tagging.ecl | 1 +
xen/common
quot;.
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/x86_emulate/decode.c | 6 --
xen/arch/x86/x86_emulate/x86_emulate.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/x86_emulate/decode.c
b/xen/arch/x86/x86_emulate/deco
The pseudo keyword fallthrough shall be used to make explicit the
fallthrough intention at the end of a case statement (doing this
through comments is deprecated).
Signed-off-by: Federico Serafini
---
xen/arch/x86/x86_emulate/x86_emulate.h | 10 ++
1 file changed, 10 insertions(+)
diff
Define pseudo keyword fallthrough for the x86 emulator,
use it and tag the rule as clean.
Federico Serafini (3):
x86/emul: define pseudo keyword fallthrough
x86/emul: use pseudo keyword fallthrough
automation/eclair: tag Rule 16.3 as clean
automation/eclair_analysis/ECLAIR/tagging.ecl
Tag MISRA C:2012 Rule 16.3 as clean for both architectures:
new violations will cause a failure of the CI/CD pipeline.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/tagging.ecl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/automation
or 'void
*', and thereby MISRA won't complain about code with such conversions?
Exactly, taking into account section 4.7 of GCC manual.
--
Federico Serafini, M.Sc.
Software Engineer, BUGSENG (http://bugseng.com)
Escape the final dot of the comment and extend the search of a
fallthrough comment up to 2 lines after the last statement.
Fixes: a128d8da913b ("automation/eclair: add deviations for MISRA C:2012 Rule
16.3")
Reported-by: Jan Beulich
Signed-off-by: Federico Serafini
Acked-by: Stefano
Add missing break statements to address violations of MISRA C Rule
16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
Changes in v3:
- addressed all violations of R16.3 in vpmu_intel.c
---
x
Add break or pseudo keyword fallthrough to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
Changes in v3:
- use break instead of fallthrough.
---
xen/a
The current comment making explicit the fallthrough intention does
not follow the agreed syntax: replace it with the pseduo keyword.
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x86/cpuid.c | 3 +--
1 file changed
Add defensive return statement at the end of an unreachable
default case. Other than improve safety, this meets the requirements
to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
statement shall terminate every switch-clause".
Signed-off-by: Federico Serafini
Add a missing break statement to address a violation of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x8
Add missing break statement to address a violation of MISRA C
Rule 16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x86/h
This patch series fixes a missing escape in a deviation and addresses some
violations.
Federico Serafini (12):
automation/eclair: fix deviation of MISRA C Rule 16.3
x86/cpuid: use fallthrough pseudo keyword
x86/domctl: address a violation of MISRA C Rule 16.3
x86/vpmu: address violations
Add missing break statements to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch
Add missing break statement to address a violation of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x86/do
Add pseudo keyword fallthrough to meet the requirements to deviate
a violation of MISRA C Rule 16.3 ("An unconditional `break'
statement shall terminate every switch-clause").
No functional change.
Signed-off-by: Federico Serafini
---
Changes in v3:
- better indentation of fallth
Add pseudokeyword fallthrough to meet the requirements to deviate
a violation of MISRA C Rul 16.3: "An unconditional `break' statement
shall terminate every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Be
ment is reached.
Signed-off-by: Federico Serafini
---
Changes in v3:
- squashed here modifications of pmtimer.c;
- no blank line after fallthrough;
- better indentation of fallthrough.
---
xen/arch/x86/hvm/emulate.c | 9 ++---
xen/arch/x86/hvm/hvm.c | 5 +
xen/arch/x86/hvm/hypercall.c
On 01/07/24 10:47, Jan Beulich wrote:
On 26.06.2024 11:28, Federico Serafini wrote:
@@ -2798,11 +2800,12 @@ void hvm_emulate_one_vm_event(enum emul_kind kind,
unsigned int trapnr,
hvio->mmio_insn_bytes = sizeof(hvio->mmio_insn);
memcpy(hvio->mmio_insn, curr->a
On 01/07/24 10:49, Jan Beulich wrote:
On 26.06.2024 11:28, Federico Serafini wrote:
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -118,9 +118,11 @@ static int pt_irq_masked(struct periodic_time *pt)
return 0;
gsi = hvm_isa_irq_to_gsi(pt->
Add missing break statement to address a violation of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x86/do
Escape the final dot of the comment and extend the search of a
fallthrough comment up to 2 lines after the last statement.
Fixes: Fixes: a128d8da91 ("automation/eclair: add deviations for MISRA C:2012
Rule 16.3")
Reported-by: Jan Beulich
Signed-off-by: Federico Serafini
Acked-b
Add a missing break statement to address a violation of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x8
This patch series fixes a missing escape in a deviation and addresses some
violations.
Federico Serafini (9):
automation/eclair: fix deviation of MISRA C Rule 16.3
x86/cpuid: use fallthrough pseudo keyword
x86/domctl: address a violation of MISRA C Rule 16.3
x86/vpmu: address violations
Add break or pseudo keyword fallthrough to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/traps.c | 3 +++
eachable return statement is reached.
Signed-off-by: Federico Serafini
---
Changes in v4:
- do not separate different parts of HVM:
a) squash patches 8, 11 and 12 of v3 into this patch;
b) address also violations of SVM and VMX;
- re-arrange fallthrough positioning to comply with Coverity
Add missing break statements to address violations of MISRA C Rule
16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/cpu/vpmu.c | 3 +++
x
The current comment making explicit the fallthrough intention does
not follow the agreed syntax: replace it with the pseduo keyword.
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x86/cpuid.c | 3 +--
1 file changed
Add defensive return statement at the end of an unreachable
default case. Other than improve safety, this meets the requirements
to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
statement shall terminate every switch-clause".
Signed-off-by: Federico Serafini
Add missing break statements to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch
On 13/07/24 01:25, Stefano Stabellini wrote:
On Tue, 2 Jul 2024, Federico Serafini wrote:
On 01/07/24 10:47, Jan Beulich wrote:
On 26.06.2024 11:28, Federico Serafini wrote:
@@ -2798,11 +2800,12 @@ void hvm_emulate_one_vm_event(enum emul_kind kind,
unsigned int trapnr,
hvio
On 16/07/24 08:59, Jan Beulich wrote:
On 15.07.2024 18:48, Federico Serafini wrote:
This patch series fixes a missing escape in a deviation and addresses some
violations.
Federico Serafini (9):
automation/eclair: fix deviation of MISRA C Rule 16.3
x86/cpuid: use fallthrough pseudo
On 16/07/24 09:08, Jan Beulich wrote:
On 15.07.2024 18:48, Federico Serafini wrote:
Add break or pseudo keyword fallthrough to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-o
On 24/07/24 11:45, Jan Beulich wrote:
On 15.07.2024 18:48, Federico Serafini wrote:
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -499,7 +499,7 @@ safe."
-doc_end
-doc_begin="Switch clauses ending with an explic
ed-by: Jan Beulich
Signed-off-by: Federico Serafini
Acked-by: Stefano Stabellini
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl
b/automation/eclair_analysis/ECLAIR/deviations
Add missing break statements to address violations of MISRA C Rule
16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Reviewed-by: Jan Beulich
---
xen/arch
This patch series fixes a missing escape in a deviation and addresses some
violations.
Federico Serafini (8):
automation/eclair: fix deviation of MISRA C Rule 16.3
x86/vpmu: address violations of MISRA C Rule 16.3
x86/traps: address violations of MISRA C Rule 16.3
x86/mce: address
Add missing break statements to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch
MISRA C Rule 16.3 states that "An unconditional `break' statement shall
terminate every switch-clause".
Add pseudo keyword fallthrough or missing break statement
to address violations of the rule.
Signed-off-by: Federico Serafini
---
Changes in v5:
- separate mechanical change
Add defensive return statement at the end of an unreachable
default case. Other than improve safety, this meets the requirements
to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
statement shall terminate every switch-clause".
Signed-off-by: Federico Serafini
As a defensive measure, make sure to signal an error to the caller
if an unreachable program point is reached.
Signed-off-by: Federico Serafini
---
xen/arch/x86/hvm/emulate.c | 1 +
xen/arch/x86/hvm/hvm.c | 4
xen/arch/x86/hvm/vmx/vmcs.c | 2 ++
3 files changed, 7 insertions(+)
diff
Add a missing break statement to address a violation of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/arch/x8
Add break or pseudo keyword fallthrough to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate
every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
Reviewed-by: Stefano Stabellini
Acked-by: Jan Beulich
---
xen/a
Sort -v monitored guidelines and tag more guidelines as clean.
Federico Serafini (2):
automation/eclair: sort monitored guidelines with -V
automation/eclair: tag more guidelines as clean
.../eclair_analysis/ECLAIR/monitored.ecl | 92 +--
automation/eclair_analysis
To improve readability, sort guidelines with -V.
No functional change.
---
.../eclair_analysis/ECLAIR/monitored.ecl | 92 +--
1 file changed, 46 insertions(+), 46 deletions(-)
diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl
b/automation/eclair_analysis/ECLAIR/m
Tag more of the accepted guidelines as clean to avoid regressions.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/tagging.ecl | 4
1 file changed, 4 insertions(+)
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl
b/automation/eclair_analysis/ECLAIR
Update ECLAIR configuration to deviate more cases where an
unintentional fallthrough cannot happen.
Tag Rule 16.3 as clean for arm.
Signed-off-by: Federico Serafini
---
Hi, v4 of this patch has been on hold due to discussion on whether or not
to consider switch clauses ending with
Add MISRA C:2012 Rules 13.2 and 18.2 to the monitored set.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/monitored.ecl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl
b/automation/eclair_analysis/ECLAIR
'.
Remove redundant comment-based deviations.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 4
docs/misra/deviations.rst| 5 +
xen/include/xen/bitmap.h | 3 ---
3 files changed, 9 inse
On 28/08/24 16:50, Jan Beulich wrote:
On 28.08.2024 15:12, Federico Serafini wrote:
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus
be deviated
On 29/08/24 02:42, Stefano Stabellini wrote:
On Wed, 28 Aug 2024, Federico Serafini wrote:
Update ECLAIR configuration of MISRA C:2012 Rule 20.7 ("Expressions
resulting from the expansion of macro parameters shall be enclosed in
parentheses") to tag as 'safe' the exp
Update ECLAIR configuration to take into account the deviations
agreed during MISRA meetings.
Amend an existing entry of Rule 14.4 in deviations-rst:
it is not a project-wide deviation.
Tag Rule 14.4 as clean for arm.
Signed-off-by: Federico Serafini
---
Changes in v2:
- reordered deviations
Define "switch-clause" in terms of the C specification.
Deviate Rule 16.4.
Federico Serafini (2):
docs/misra: add Terms & Definitions section to rules.rst
automation/eclair: add deviation for Rule 16.4
automation/eclair_analysis/ECLAIR/deviations.ecl | 8
docs/misra/
MISRA C:2012 Rule 16.4 states that "Every switch statement shall have a
default label".
Update ECLAIR configuration to take into account the deviations
agreed during MISRA meetings.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 8
ulich
Signed-off-by: Federico Serafini
---
Jan you were not completely satisfied by the definition but I didn't find
a better one.
---
docs/misra/rules.rst | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index b7b4
To improve clarity and ease of navigation do not show reports related
to adopted code in the scheduled analysis.
Configuration options are commented out because they may be useful
in the future.
Signed-off-by: Simone Ballarin
Signed-off-by: Federico Serafini
---
.../eclair_analysis/ECLAIR
On 03/05/24 21:14, Andrew Cooper wrote:
On 29/04/2024 4:21 pm, Federico Serafini wrote:
Patch 1/3 does some preparation work.
Patch 2/3, as the title says, removes allow_failure = true for triggered
analyses.
Patch 3/3 makes explicit that initally no files are tagged as adopted, this
is
On 03/05/24 21:46, Andrew Cooper wrote:
On 03/05/2024 8:44 pm, Federico Serafini wrote:
On 03/05/24 21:14, Andrew Cooper wrote:
On 29/04/2024 4:21 pm, Federico Serafini wrote:
Patch 1/3 does some preparation work.
Patch 2/3, as the title says, removes allow_failure = true for
triggered
Update ECLAIR configuration to deviate more cases where an
unintentional fallthrough cannot happen.
Add Rule 16.3 to the monitored set and tag as clean for arm.
Signed-off-by: Federico Serafini
---
In previous discussions about Rule 16.3, the preference expressed was to deviate
cases where a
Update ECLAIR configuration to deviate more cases where an
unintentional fallthrough cannot happen.
Add Rule 16.3 to the monitored set and tag it as clean for arm.
Signed-off-by: Federico Serafini
---
The v1 of this patch did not receive any comments:
https://lists.xenproject.org/archives/html
On 13/06/24 10:16, Jan Beulich wrote:
On 13.06.2024 08:38, Federico Serafini wrote:
Update ECLAIR configuration to deviate more cases where an
unintentional fallthrough cannot happen.
Add Rule 16.3 to the monitored set and tag it as clean for arm.
Signed-off-by: Federico Serafini
Update ECLAIR configuration to deviate some cases where not using
the return value of a function is not dangerous.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 4
docs/misra/deviations.rst| 11 +++
2 files changed
On 13/06/24 12:08, Jan Beulich wrote:
On 13.06.2024 11:07, Federico Serafini wrote:
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -364,6 +364,17 @@ Deviations related to MISRA C:2012 Rules:
by `stdarg.h`.
- Tagged as `deliberate` for ECLAIR.
+ * - R17.7
On 13/06/24 12:03, Jan Beulich wrote:
On 13.06.2024 11:02, Federico Serafini wrote:
On 13/06/24 10:16, Jan Beulich wrote:
On 13.06.2024 08:38, Federico Serafini wrote:
+ * - R16.3
+ - Switch clauses ending with a do-while-false which, in turn, ends with an
Maybe more precisely &quo
On 13/06/24 12:08, Jan Beulich wrote:
On 13.06.2024 11:07, Federico Serafini wrote:
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -364,6 +364,17 @@ Deviations related to MISRA C:2012 Rules:
by `stdarg.h`.
- Tagged as `deliberate` for ECLAIR.
+ * - R17.7
Update ECLAIR configuration to deviate some cases where not using
the return value of a function is not dangerous.
Signed-off-by: Federico Serafini
---
Changes in v2:
- do not deviate strlcpy and strlcat.
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 4
docs/misra/deviations.rst
Update ECLAIR configuration to deviate some cases where not using
the return value of a function is not dangerous.
Signed-off-by: Federico Serafini
---
Changes in v3:
- removed unwanted underscores;
- grammar fixed;
- do not constraint to the first actual argument.
Changes in v2:
- do not
Update ECLAIR configuration to deviate more cases where an
unintentional fallthrough cannot happen.
Add Rule 16.3 to the monitored set and tag it as clean for arm.
Signed-off-by: Federico Serafini
---
Changes from v2:
- fixed grammar;
- reprhased deviations regarding do-while-false and
eby only a few values
are handled by the switch statement and nothing should be done for
others (nothing to do in the default case).
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/arm/cpuerrata.c| 1 +
xen/arch/arm/gic.c | 1 +
xen/arch/arm/i
On 17/06/24 12:03, Jan Beulich wrote:
On 17.06.2024 11:49, Federico Serafini wrote:
MISRA C Rule 16.4 states that every `switch' statement shall have a
`default' label" and a statement or a comment prior to the
terminating break statement.
This patch addresses some violati
overed in this patch,
the default label has a return statement that does not violates Rule 16.4.
No functional change.
Signed-off-by: Federico Serafini
---
Changes in v2:
as Jan pointed out, in the v1 some patterns were not explicitly identified
(https://lore.kernel.org/xen-devel/cad05a5c
On 19/06/24 13:17, Julien Grall wrote:
Hi Federico,
On 19/06/2024 10:29, Federico Serafini wrote:
MISRA C Rule 16.4 states that every `switch' statement shall have a
`default' label" and a statement or a comment prior to the
terminating break statement.
This patch addresses som
handling functions.
Signed-off-by: Federico Serafini
---
.../eclair_analysis/ECLAIR/deviations.ecl | 16 ++
docs/misra/deviations.rst | 21 +++
2 files changed, 37 insertions(+)
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl
b/
Add missing break statements to address violations of MISRA C Rule 16.3:
"An unconditional `break' statement shall terminate every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/cpu/mcheck/mce_amd.c | 1 +
xen/arch/x86/cpu/mcheck/mce_in
Update ECLAIR configuration:
- allow to deviate MISRA C Rule 16.3 using different version of
hypened fall-through;
- search for the comment for 2 lines after the last statement.
Signed-off-by: Federico Serafini
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +-
docs/misra
Add missing break statement to address a violation of MISRA C
Rule 16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/hvm/vlapic.c | 1 +
1 file changed, 1 insertion(+)
diff -
Add pseudo keyword fallthrough to meet the requirements to deviate
a violation of MISRA C Rule 16.3 ("An unconditional `break'
statement shall terminate every switch-clause").
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/hvm/vpt.c | 2 ++
1 file change
Add break or pseudo keyword fallthrough to address violations of
MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/traps.c | 3 +++
1 file changed, 3 insertions(+
Add pseudokeyword fallthrough to meet the requirements to deviate
a violation of MISRA C Rul 16.3: "An unconditional `break' statement
shall terminate every switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/hvm/vpic.c | 1 +
1 file chang
Add missing break statement to address a violation of MISRA C Rule 16.3:
"An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/domctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git
The current comment making explicit the fallthrough intention does
not follow the agreed syntax: replace it with the pseduo keyword.
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/cpuid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/xen/arch
Add defensive return statement at the end of an unreachable
default case. Other than improve safety, this meets the requirements
to deviate a violation of MISRA C Rule 16.3.
Signed-off-by: Federico Serafini
---
xen/arch/x86/mm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/xen/arch/x86
Add missing break statements to address violations of MISRA C Rule
16.3: "An unconditional `break' statement shall terminate every
switch-clause".
No functional change.
Signed-off-by: Federico Serafini
---
xen/arch/x86/cpu/vpmu.c | 3 +++
xen/arch/x86/cpu/vpmu_intel.c
1 - 100 of 551 matches
Mail list logo