All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Nicola Vetrini" <nicola.vetrini@bugseng.com>
Subject: [PATCH 4/6] x86/cpufreq: annotate Eclair false-positives for rule 18.2
Date: Wed, 9 Sep 2026 15:00:42 +0200	[thread overview]
Message-ID: <6fe2a230-4c36-48ce-93c0-ee8d75500d3a@suse.com> (raw)
In-Reply-To: <c3614ea0-e5b3-4cfd-820b-9320ac327292@suse.com>

"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@bugseng.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
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;



  parent reply	other threads:[~2026-09-09 13:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 12:57 [PATCH 0/6] x86: address remaining rule 18.2 violations and mark clean Jan Beulich
2026-09-09 12:59 ` [PATCH 1/6] x86/PV: adjust APPEND_CALL() to comply to Misra rule 18.2 Jan Beulich
2026-09-09 12:59 ` [PATCH 2/6] x86/alternatives: adjust _apply_alternatives() " Jan Beulich
2026-09-09 13:00 ` [PATCH 3/6] x86/EFI: adjust efi_multiboot2_prelude() " Jan Beulich
2026-09-09 13:54   ` Marek Marczykowski
2026-09-09 13:00 ` Jan Beulich [this message]
2026-09-09 13:01 ` [PATCH 5/6] x86/Viridian: annotate Eclair false-positives for " Jan Beulich
2026-09-09 13:13   ` Nicola Vetrini
2026-09-09 13:01 ` [PATCH 6/6] automation/Eclair: tag rules 18.1 and 18.2 as clean Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fe2a230-4c36-48ce-93c0-ee8d75500d3a@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=nicola.vetrini@bugseng.com \
    --cc=roger@xenproject.org \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.