mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Rule 10.1: Operands shall not be of an
inappropriate essential type
The following are non-compliant:
- boolean used as a numeric value.
The result of the '__isleap' macro is a boolean.
Suppress analyser tool finding.
The result of 'NOW() > timeout' is a boolean,
which is compared to a numeric value. Fix this.
Regression was introdiced by commit:
be7f047e08 (xen/arm: smmuv3: Replace linux functions with xen functions.)
Remove pointless cast '(const unsigned short int *)'.
The source array and the destination pointer are both of the same type.
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
133 lines
5.5 KiB
JSON
133 lines
5.5 KiB
JSON
{
|
|
"version": "1.0",
|
|
"content": [
|
|
{
|
|
"id": "SAF-0-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.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": "MC3A2.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": "MC3A2.R10.1"
|
|
},
|
|
"name": "MC3A2.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": "MC3A2.R20.4"
|
|
},
|
|
"name": "MC3A2.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": "MC3A2.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": "MC3A2.R16.2"
|
|
},
|
|
"name": "MC3A2.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": "MC3A2.R20.12"
|
|
},
|
|
"name": "MC3A2.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": "MC3A2.R20.7"
|
|
},
|
|
"name": "MC3A2.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": {
|
|
"eclair": "MC3A2.D4.10"
|
|
},
|
|
"name": "Dir 4.10: headers that leave it up to the caller to include them correctly",
|
|
"text": "Headers that deliberatively leave the responsability of their correct inclusion to the caller are allowed."
|
|
},
|
|
{
|
|
"id": "SAF-9-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.D4.10"
|
|
},
|
|
"name": "Dir 4.10: empty headers",
|
|
"text": "Empty headers pose no risk if included more than once."
|
|
},
|
|
{
|
|
"id": "SAF-10-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.D4.10"
|
|
},
|
|
"name": "Dir 4.10: direct inclusion guard before",
|
|
"text": "Headers with just the direct inclusion guard before the inclusion guard are safe."
|
|
},
|
|
{
|
|
"id": "SAF-11-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.R16.6"
|
|
},
|
|
"name": "Rule 16.6: single clause due to kconfig",
|
|
"text": "A switch statement with a single switch clause because other switch clauses are disabled in a given kconfig is safe."
|
|
},
|
|
{
|
|
"id": "SAF-12-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.R16.6"
|
|
},
|
|
"name": "Rule 16.6: single clause due to future expansion",
|
|
"text": "A switch statement with a single switch clause to purposely enable future additions of new cases is safe."
|
|
},
|
|
{
|
|
"id": "SAF-13-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.R8.4"
|
|
},
|
|
"name": "Rule 8.4: compiler-called function",
|
|
"text": "A function, all invocations of which are compiler generated, does not need to have a visible declaration prior to its definition."
|
|
},
|
|
{
|
|
"id": "SAF-14-safe",
|
|
"analyser": {
|
|
"eclair": "MC3A2.R10.1"
|
|
},
|
|
"name": "Rule 10.1: use boolean as an array index",
|
|
"text": "Using a boolean type as an array index is safe."
|
|
},
|
|
{
|
|
"id": "SAF-15-safe",
|
|
"analyser": {},
|
|
"name": "Sentinel",
|
|
"text": "Next ID to be used"
|
|
}
|
|
]
|
|
}
|