Files
xen/docs/misra/safe.json
T
Nicola Vetrini 0dca0f2b9a automation/eclair: address violations of MISRA C Rule 20.7
MISRA C Rule 20.7 states: "Expressions resulting from the expansion
of macro parameters shall be enclosed in parentheses".

The helper macro bitmap_switch has parameters that cannot be parenthesized
in order to comply with the rule, as that would break its functionality.
Moreover, the risk of misuse due developer confusion is deemed not
substantial enough to warrant a more involved refactor, thus the macro
is deviated for this rule.

No functional change.

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-27 13:45:18 +02:00

77 lines
3.3 KiB
JSON

{
"version": "1.0",
"content": [
{
"id": "SAF-0-safe",
"analyser": {
"eclair": "MC3R1.R8.6",
"coverity": "misra_c_2012_rule_8_6_violation"
},
"name": "Rule 8.6: linker script defined symbols",
"text": "It is safe to declare this symbol because it is defined in the linker script."
},
{
"id": "SAF-1-safe",
"analyser": {
"eclair": "MC3R1.R8.4"
},
"name": "Rule 8.4: asm-only definition",
"text": "Functions and variables used only by asm modules do not need to have a visible declaration prior to their definition."
},
{
"id": "SAF-2-safe",
"analyser": {
"eclair": "MC3R1.R10.1"
},
"name": "MC3R1.R10.1: use of an enumeration constant in an arithmetic operation",
"text": "This violation can be fixed with a cast to (int) of the enumeration constant, but a deviation was chosen due to code readability (see also the comment in BITS_TO_LONGS)."
},
{
"id": "SAF-3-safe",
"analyser": {
"eclair": "MC3R1.R20.4"
},
"name": "MC3R1.R20.4: allow the definition of a macro with the same name as a keyword in some special cases",
"text": "The definition of a macro with the same name as a keyword can be useful in certain configurations to improve the guarantees that can be provided by Xen. See docs/misra/deviations.rst for a precise rationale for all such cases."
},
{
"id": "SAF-4-safe",
"analyser": {
"eclair": "MC3R1.R17.1"
},
"name": "Rule 17.1: internal helper functions made to break long running hypercalls into multiple calls.",
"text": "They need to take a variable number of arguments depending on the original hypercall they are trying to continue."
},
{
"id": "SAF-5-safe",
"analyser": {
"eclair": "MC3R1.R16.2"
},
"name": "MC3R1.R16.2: using a case label when the most closely-enclosing compound statement is not a switch statement",
"text": "A switch label enclosed by some compound statement that is not the body of a switch is permitted within local helper macros that are unlikely to be misused or misunderstood."
},
{
"id": "SAF-6-safe",
"analyser": {
"eclair": "MC3R1.R20.12"
},
"name": "MC3R1.R20.12: use of a macro argument that deliberately violates the Rule",
"text": "A macro parameter that is itself a macro is intentionally used within the macro both as a regular parameter and for text replacement."
},
{
"id": "SAF-7-safe",
"analyser": {
"eclair": "MC3R1.R20.7"
},
"name": "MC3R1.R20.7: deliberately non-parenthesized macro argument",
"text": "A macro parameter expands to an expression that is non-parenthesized, as doing so would break the functionality."
},
{
"id": "SAF-8-safe",
"analyser": {},
"name": "Sentinel",
"text": "Next ID to be used"
}
]
}