|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 4/6] x86/cpufreq: annotate Eclair false-positives for rule 18.2
"Subtraction between pointers shall only be applied to pointers that
address elements of the same array" is not violated here. Elsewhere, on
simple "e - s" Eclair manages to notice this; apparently "(end ?: e)" is
too complex ("end" being derived from "s" a few lines earlier).
Suggested-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
As per Nicola Eclair 16.0.0 has this fixed.
--- a/docs/misra/false-positive-eclair.json
+++ b/docs/misra/false-positive-eclair.json
@@ -3,6 +3,13 @@
"content": [
{
"id": "SAF-0-false-positive-eclair",
+ "violation-id": "MC3A2.R18.2",
+ "tool-version": "3.14.0",
+ "name": "Rule 18.2: pointer subtraction",
+ "text": "Cmdline parsing start/end pointers point into the same
array"
+ },
+ {
+ "id": "SAF-1-false-positive-eclair",
"violation-id": "",
"tool-version": "",
"name": "Sentinel",
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -67,6 +67,7 @@ int __init amd_cppc_cmdline_parse(const
{
printk(XENLOG_WARNING
"cpufreq/amd-cppc: option '%.*s' not recognized\n",
+ /* SAF-0-false-positive-eclair s, e, and end point into the
cmdline array */
(int)((end ?: e) - s), s);
return -EINVAL;
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -85,6 +85,7 @@ int __init hwp_cmdline_parse(const char
if ( !hwp_handle_option(s, end) )
{
printk(XENLOG_WARNING "cpufreq/hwp: option '%.*s' not
recognized\n",
+ /* SAF-0-false-positive-eclair s, e, and end point into the
cmdline array */
(int)((end ?: e) - s), s);
return -EINVAL;
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |