Commit Graph
100 Commits
Author SHA1 Message Date
Federico Serafini 6b9b96ddeb automation/eclair: tag more guidelines as clean
Tag more of the accepted guidelines as clean to avoid regressions.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-08-06 12:30:17 -07:00
Federico Serafini e03cea171a automation/eclair: sort monitored guidelines with -V
To improve readability, sort guidelines with -V.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-08-06 12:30:17 -07:00
Federico Serafini 643c2b6bc7 x86/hvm: add defensive statements in unreachable program points
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 <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-07-31 13:09:58 +02:00
Federico Serafini 4cf7e13116 x86/hvm: address violations of MISRA C Rule 16.3
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 <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-07-31 13:09:33 +02:00
Federico Serafini c8a92406c2 x86/mpparse: address a violation of MISRA C Rule 16.3
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-07-30 11:53:46 +02:00
Federico Serafini 20716a4b1c x86/mce: address violations of MISRA C Rule 16.3
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-07-30 11:53:26 +02:00
Federico Serafini 2c9044adf8 x86/traps: address violations of MISRA C Rule 16.3
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-07-30 11:53:06 +02:00
Federico Serafini cd94e7cff8 x86/vpmu: address violations of MISRA C Rule 16.3
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-07-30 11:52:47 +02:00
Federico Serafini 5f6548ea1f automation/eclair: fix deviation of MISRA C Rule 16.3
Add missing escape for the final dot of the fallthrough comment,
extend the search of a fallthrough comment up to 2 lines after the last
statement and improve the text of the justification.

Fixes: a128d8da91 ("automation/eclair: add deviations for MISRA C:2012 Rule 16.3")
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-07-30 11:52:31 +02:00
Federico Serafini c6661e8910 x86/domctl: address a violation of MISRA C Rule 16.3
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-07-24 11:43:18 +02:00
Federico Serafini 9d3c8dc1c0 x86/cpuid: use fallthrough pseudo keyword
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-07-24 11:42:53 +02:00
Federico Serafini 6d41f5b9e1 automation/eclair: add deviations agreed in MISRA meetings
Update ECLAIR configuration to take into account the deviations
agreed during the MISRA meetings.

While doing this, remove the obsolete "Set [123]" comments.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2024-06-27 15:38:33 -07:00
Federico Serafini 0ac3b175e7 automation/eclair: configure Rule 13.6 and custom service B.UNEVALEFF
Rule 13.6 states that "The operand of the `sizeof' operator shall not
contain any expression which has potential side effects".

Define service B.UNEVALEFF as an extension of Rule 13.6 to
check for unevalued side effects also for typeof and alignof operators.

Update ECLAIR configuration to deviate uses of BUILD_BUG_ON and
alternative_v?call[0-9] for both Rule 13.6 and B.UNEVALEFF.

Add service B.UNEVALEFF to the accepted.ecl guidelines to check
"violations" in the weekly analysis.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2024-06-25 13:41:05 -07:00
Federico Serafini c2f4ea4dc9 automation/eclair: add more guidelines to the monitored set
Add more accepted guidelines to the monitored set to check them at each
commit.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2024-06-24 16:41:12 -07:00
Federico Serafini 5add709cc6 automation/eclair: add deviations of MISRA C Rule 5.5
MISRA C Rule 5.5 states that "Identifiers shall be distinct from macro
names".

Update ECLAIR configuration to deviate:
- macros expanding to their own name;
- clashes between macros and non-callable entities;
- clashes related to the selection of specific implementations of string
  handling functions.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2024-06-24 16:40:05 -07:00
Federico Serafini 912412f97a automation/eclair: add deviation for MISRA C Rule 17.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 <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2024-06-24 16:39:09 -07:00
Federico Serafini b0082b9083 automation/eclair: hide reports coming from adopted code in scheduled analysis
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 <simone.ballarin@bugseng.com>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-09 18:03:24 -07:00
Federico Serafini 3d1033c911 automation/eclair: add deviation of MISRA C:2012 Rule 14.4
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-09 18:19:49 +01:00
Federico Serafini 692f6199bd automation/eclair: add deviation for Rule 16.4
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 <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-06 09:24:50 +02:00
Federico Serafini 50a4f7c177 docs/misra: add Terms & Definitions section to rules.rst
Add a section for terms and definitions used by MISRA but expressed
in terms of the C specification.

Add a definition of "switch clause" to the newly-introduced section.

Link the first use of the term "switch clause" in the document to its
definition.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-06 09:24:37 +02:00
Federico Serafini feb9158a62 automation/eclair: make explicit there are no adopted files by default
Update ECLAIR configuration to consider no adopted files by default.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-01 12:49:23 -07:00
Federico Serafini 7556f46a9b automation: do not allow failure for triggered analyses
Do not allow_failure for triggered analyses:
introducing regressions of clean guidelines will cause a CI failure.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-01 12:49:20 -07:00
Federico Serafini c1aa6fb5f6 automation/eclair: tag Rule 7.2 as clean and temporarily remove Rules 1.1 and 8.2
Update ECLAIR configuration to consider Rule 7.2 as clean.

Temporarily remove the clean tag from Rules 1.1 and 8.2:
when violations of such rules will be addressed, the clean tag will be
reintroduced.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-05-01 12:49:16 -07:00
Federico Serafini 02fbb2d591 docs/misra: mark the gzip folder as adopted code
Mark the whole gzip folder as adopted code and remove the redundant
deviation of file inflate.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2024-04-18 20:43:11 +01:00
Federico Serafini 6eeb3e86bd vsprintf: address violations of MISRA C:2012 Rule 16.3
MISRA C:2012 Rule 16.3 states: "An unconditional `break' statement
shall terminate every switch-clause".

In order to meet the requirements to deviate the rule:
1) refactor the for loop to make the switch-clause ending with a
   return statement (note that adding a break at the end of the
   switch-clause would result in a violation of Rule 2.1
   "A project shall not contain unreachable code");
2) add pseudo-keyword fallthrough.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-04-04 12:01:50 +02:00
Federico Serafini 226bdb155b xen/sched: address violations of MISRA C:2012 Rule 16.3
Add break statement to address a violation of MISRA C:2012 Rule 16.3
("An unconditional `break' statement shall terminate every
switch-clause").
Replace deprecated comment /* FALLTHRU */ with pseudo-keyword
fallthrough to meet the requirements to deviate the rule.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@cloud.com>
2024-04-04 12:01:27 +02:00
Federico Serafini ac682fbac1 xen/vm-event: address a violation of MISRA C:2012 Rule 16.3
Add break statement to 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 <federico.serafini@bugseng.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
2024-04-03 09:38:41 +02:00
Federico Serafini cde0c58714 xen/evtchn: address a violation of MISRA C:2012 Rule 16.3
Add break statement to 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 <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-04-03 09:38:22 +02:00
Federico Serafini 163ea7d9a8 console: address a violation of MISRA C:2012 Rule 16.3
Add break statement to 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 <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-04-03 09:37:47 +02:00
Federico Serafini 2c205ce5c0 xen/domctl: address a violation of MISRA C:2012 Rule 16.3
Add break statement to 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 <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-04-03 09:37:26 +02:00
Federico Serafini f93d8dd519 automation/eclair: allow parameter name "unused"
Update ECLAIR configuration of MISRA C:2012 Rule 8.3 to deviate
violations involving parameter name "unused" (with an optional
numeric suffix): it makes explicit the intention of not using such
parameter within the function.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-03-18 13:52:53 +01:00
Federico Serafini 8a8d5c22af perfc: add pseudo-keyword fallthrough
Add pseudo-keyword fallthrough to make explicit the intention of the
code and meet requirements to deviate MISRA C:2012 Rule 16.3
("An unconditional `break' statement shall terminate every
switch-clause").

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-03-18 13:51:17 +01:00
Federico Serafini 68e008db0c xen: avoid grep fodder define and undef
Place an "#if 0" before grep fodder #define-s and remove
the #undef-s.

This addresses violations of MISRA C:2012 Rules 20.5 ("#undef should
not be used") and 5.5 ("Identifiers shall be distinct from macro
names").

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2024-03-14 13:55:27 +01:00
Federico Serafini ef31ffbc3d automation/eclair: add deviation for MISRA C:2012 Rule 16.6
Update ECLAIR configuration to take into account the deviations
agreed during MISRA meetings.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-03-08 18:22:49 -08:00
Federico Serafini e1de3a0536 automation/eclair: tag MISRA C:2012 Rule 8.2 as clean
Update ECLAIR configuration to consider Rule 8.2 as clean.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2024-02-29 15:23:31 -08:00
Federico Serafini b87697fc1a automation/eclair: fully deviate MISRA C:2012 Rules 5.7 and 18.7
Update ECLAIR configuration to fully deviate Rules 5.7 and 18.7
as agreed during MISRA meeetings.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-02-29 15:23:31 -08:00
Federico Serafini 54557ee9b4 x86/uaccess: add attribute noreturn to __{get,put}_user_bad()
__get_user_bad() and __put_user_bad() are undefined symbols used
to assert the unreachability of a program point:
a call to one of such functions is optimized away if it is considered
unreachable by the compiler. Otherwise, a linker error is reported.

In accordance with the purpose of such constructs:
1) add the attribute noreturn to __get_user_bad() and __put_user_bad();
2) change return type of __get_user_bad() to void (returning long is a
   leftover from the past).

Point (1) meets the requirements to deviate MISRA C:2012 Rule 16.3
("An unconditional break statement shall terminate every switch
clause") since functions with noreturn attribute are considered
as allowed terminals for switch clauses.

Point (2) addresses several violations of MISRA C:2012 Rule 17.7
("The value returned by a function having non-void return type
shall be used").

While there also zap "extern".

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2024-02-22 11:53:23 +01:00
Federico Serafini 5a3ace21f3 xen/arm: smmu-v3: address violations of MISRA C:2012 Rule 16.3
Add a break statement at the end of the switch-clauses to address
violations of MISRA C:2012 Rule 16.3 ("An unconditional `break'
statement shall terminate every switch-clause").
No funtional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com
2024-01-05 14:38:23 -08:00
Federico Serafini e9786ba9ee xen/arm: mmu: address a violations of MISRA C:2012 Rule 16.3
Add missing break at the end of the switch-clause to 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 <federico.serafini@bugseng.com>
Acked-by: Julien Grall <jgrall@amazon.com>
2023-12-20 10:20:16 -08:00
Federico Serafini 2750111969 xen/arm: guest_walk: address violations of MISRA C:2012 Rule 16.3
Add missing break statements to address violations of Rule 16.3
("An unconditional `break' statement shall terminate every
switch-clause").
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Julien Grall <jgrall@amazon.com>
2023-12-20 10:19:57 -08:00
Federico Serafini f1e956cdbf xen/arm: traps: address violations of MISRA C:2012 Rule 16.3
MISRA C:2012 Rule 16.3 states: "An unconditional `break' statement
shall terminate every switch-clause".

Add missing break statements to address violations of Rule 16.3.
Add pseudo-keyword "fallthrough" to make explicit the intended
behavior and satisfy the requirements to deviate Rule 16.3.
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Julien Grall <jgrall@amazon.com>
2023-12-20 10:19:34 -08:00
Federico Serafini 7d18ab2b9b xen/arm: gic-v3: address violations of MISRA C:2012 Rule 16.3
Add the pseudo-keyword fallthrough to meet the requirements to
deviate Rule 16.3 ("An unconditional `break' statement shall terminate
every switch-clause").
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Julien Grall <jgrall@amazon.com>
2023-12-20 10:19:15 -08:00
Federico Serafini fba913a21a docs/misra: add entries to exclude-list
Exclude efibind.h for all the architectures: it is used to build the
efi stub, which is a separate entry point for Xen when booted from EFI
firmware.
Remove redundant entries from out_of_scope.ecl.

Exclude common/coverage: it is code to support gcov, hence it is part
of the testing machinery.

Exclude decompress.h: file ported from Linux that defines a unique and
documented interface towards all the (adopted) decompress functions.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-19 17:09:38 -08:00
Federico Serafini ed45dd16c4 automation/eclair: update configuration of MISRA C:2012 Rule 5.6
Deviate typedef names that are delberately defined multiple times.

Update docs/misra/deviations.rst accordingly.

Tag Rule 5.6 as clean.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-19 17:08:47 -08:00
Federico Serafini a128d8da91 automation/eclair: add deviations for MISRA C:2012 Rule 16.3
MISRA C:2012 Rule 16.3 states that an unconditional break statement
shall terminate every switch-clause.

Update ECLAIR configuration to take into account:
  - continue, goto, return statements;
  - functions with attribute noreturn;
  - pseudo-keyword fallthrough;
  - macro BUG();
  - comments.

Update docs/misra/deviations.rst accordingly.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-19 17:08:21 -08:00
Federico Serafini 666e3c294d xen/iommu: address leftover violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-13 10:40:39 +01:00
Federico Serafini 75b6bcbd9e xen/drivers: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-13 10:40:08 +01:00
Federico Serafini 76ecfc517d x86/include: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-13 10:39:30 +01:00
Federico Serafini b9905a04e4 xen/compat: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-13 10:38:19 +01:00
Federico Serafini 35431ecb9d xen/arm: smmu: move phys_addr_t definition to linux-compat.h
Both smmu and smmu-v3 (ported from Linux) define the typedef name
"phys_addr_t": move the type definition to the common header
linux-compat.h to address violations of MISRA C:2012 Rule 5.6
("A typedef name shall be a unique identifier").
No functional change.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
2023-12-12 14:04:22 +01:00
Federico Serafini f0bb77bf73 AMD/IOMMU: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names to address violations of MISRA C:2012
Rule 8.2. Remove trailing spaces and use C standard types to comply
with XEN coding style. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-12 14:03:33 +01:00
Federico Serafini 6d5e94ca7d x86/mm: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-12 14:02:58 +01:00
Federico Serafini fbc8cff877 x86/mm: remove compat_subarch_memory_op()
Remove remove compat_subarch_memory_op() declaration: there is no
definition and there are no calls to such function in the XEN project.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-12 14:02:25 +01:00
Federico Serafini 431ada87e5 xen/acpi: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-12 14:01:56 +01:00
Federico Serafini 807321b6f3 x86/acpi: remove acpi_pic_sci_set_trigger()
Remove apci_pic_set_trigger() declaration: there is no definition and there are
no calls to such function in the XEN project.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2023-12-11 11:26:16 +01:00
Federico Serafini e4c0489ec5 xen/pci: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names to address violations of MISRA C:2012
Rule 8.2. Furthermore, use C standard types to comply with XEN coding style.
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-06 10:24:47 +01:00
Federico Serafini 24b2672695 x86/mce: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-06 10:24:14 +01:00
Federico Serafini 8b0dc4a88f x86/page: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-06 10:23:35 +01:00
Federico Serafini 1ff6d92938 automation/eclair: add deviations for MISRA C:2012 Rule 5.6
Update ECLAIR configuration to take into account the adopted files
and type "ret_t".
Update docs/misra/deviations.rst accordingly.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-05 19:23:07 -08:00
Federico Serafini 80a7669afd x86/p2m: address a violation of MISRA C:2012 Rule 8.3
Make function declaration and definition consistent changing
parameter name from "gpfn" to "gfn".
For consistency, rename also "old_gpfn" to "old_gfn".
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2023-12-05 09:54:52 +01:00
Federico Serafini f0a00ab1a6 x86/p2m: preparation work for xenmem_add_to_physmap_one()
The objective is to use parameter name "gfn" for
xenmem_add_to_physmap_one().
Since the name "gfn" is currently used as identifier for a local
variable, bad things could happen if new uses of such variable are
committed while a renaming patch is waiting for the approval.
To avoid such danger, as first thing rename the local variable from
"gfn" to "gmfn", in line with XENMAPSPACE_gmfn which is the only
space it is used with.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2023-12-05 09:54:07 +01:00
Federico Serafini e7c4b68738 xen/serial: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-01 10:50:58 +01:00
Federico Serafini 498c130104 xen/perfc: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-01 10:50:44 +01:00
Federico Serafini 5dc781b4af xen/param: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-01 10:50:34 +01:00
Federico Serafini 13832e2367 xen/kernel: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-01 10:50:01 +01:00
Federico Serafini 80aeb9ccec xen/iommu: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names to address violations of MISRA C:2012
Rule 8.2 and remove uses of u{8,16,32} in favor of C standard types.
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-12-01 10:49:49 +01:00
Federico Serafini 59f31d970f xen/notifier: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-01 10:49:34 +01:00
Federico Serafini 24dbf93ebd xen/domain: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-12-01 10:48:38 +01:00
Federico Serafini 8b15717518 xen/dmi: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-29 10:05:28 +01:00
Federico Serafini 022d7d87cc xen/cpumask: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-29 10:04:48 +01:00
Federico Serafini b0356bc0e0 xen/acpi: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-29 10:04:12 +01:00
Federico Serafini 07551414ca xen/console: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-29 10:03:46 +01:00
Federico Serafini 46f2e2c3bc xen/mm: address violations of MISRA C:2012 Rules 8.2 and 8.3
Add missing parameter names and uniform the interfaces of
modify_xen_mappings() and modify_xen_mappings_lite().

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-27 15:15:09 +01:00
Federico Serafini b82b867a66 x86/mm: preparation work to uniform modify_xen_mappings* interfaces
The objective is to use parameter name "nf" to denote "new flags"
in all the modify_xen_mappings* functions.
Since modify_xen_mappings_lite() is currently using "nf" as identifier
for a local variable, bad things could happen if new uses of such
variable are committed while a renaming patch is waiting for the
approval.
To avoid such danger, as first thing rename the local variable from
"nf" to "flags".

No functional change.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-27 15:14:00 +01:00
Federico Serafini 80c153c48b xen/sort: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-24 09:04:57 +01:00
Federico Serafini 8f45862580 xen/xalloc: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-11-23 10:09:43 +01:00
Federico Serafini 382257af0c xen/vmap: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-11-23 10:09:10 +01:00
Federico Serafini 764851a8be xen/serial: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-11-23 10:08:38 +01:00
Federico Serafini 89c1784f5f xen/common: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-23 10:07:50 +01:00
Federico Serafini b264570ba2 x86/sysctl: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:54:46 +01:00
Federico Serafini 05644bd9d2 x86/platform_hypercall: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:54:15 +01:00
Federico Serafini 168f87f590 x86/physdev: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:53:51 +01:00
Federico Serafini 8976587dc7 x86/pci: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:53:17 +01:00
Federico Serafini 45402cc136 x86/smp: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:52:43 +01:00
Federico Serafini 340a75a4f4 x86/vpmu: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:52:10 +01:00
Federico Serafini 9b1fcb4648 x86/mmconfig: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:51:41 +01:00
Federico Serafini f5b4c5f537 x86/hvm: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-20 10:51:13 +01:00
Federico Serafini 98758ae489 xen: introduce function type bug_fn_t.
Introduce function type bug_fn_t. This improves readability and could be
used to help validating that the function passed to
run_in_exception_handle() has the expected prototype.

Use the newly-intoduced type to address a violation of MISRA
C:2012 Rule 8.2.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
[stefano: minor commit improvement]
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Julien Grall <jgrall@amazon.com>
2023-11-17 18:29:51 -08:00
Federico Serafini 83e9e30510 automation/eclair: add a deviation for MISRA C:2012 Rule 8.6
Update ECLAIR configuration to take into account the search
procedure adopted by Unix linkers.
Update deviations.rst accordingly and tag Rule 8.6 as "clean".

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-11-17 18:16:34 -08:00
Federico Serafini a2e8d64c80 xen/string: address violations of MISRA C:2012 Rules 8.2 and 8.3
Add missing parameter names to address violations of
MISRA C:2012 Rule 8.2.

Resolve mismatches between parameter name "count" used in
"xen/lib/mem{cpy,move,set}.c" and parameter name "n" used in
"xen/arch/x86/string.c" to address violations of MISRA C:2012 Rule 8.3.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-11-17 18:07:26 -08:00
Federico Serafini ef8eba3535 x86/hpet: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. While there also switch a type name. No
functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:12:43 +01:00
Federico Serafini 9c27a730b8 x86/vmce: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:12:19 +01:00
Federico Serafini dc64ba0c41 x86/mcaction: address a violation of MISRA C:2012 Rule 8.2
Add missing parameter name. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:11:55 +01:00
Federico Serafini 5310230b61 x86/cpuidle: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:11:30 +01:00
Federico Serafini 614417165c x86/domain: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:10:54 +01:00
Federico Serafini 21f6d31ed6 x86/mtrr: address violation of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:10:14 +01:00
Federico Serafini 6f3f60b090 x86/mctelem: address violations of MISRA C:2012 Rule 8.2
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-16 09:09:38 +01:00
Federico Serafini 22b773d5c9 x86/psr: address a violation of MISRA C:2012 Rule 8.3
Make function declaration and definition consistent.
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-15 11:41:23 +01:00
Federico Serafini fde774154c x86/xstate: address a violation of MISRA C:2012 Rule 8.3
Make function declaration and definition consistent.
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-15 11:40:58 +01:00
Federico Serafini 76fa223438 x86/uaccess: address violations of MISRA C:2012 Rule 8.3
Make function declarations and definitions consistent.
No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2023-11-15 11:40:13 +01:00