All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Dmytro Prokopchuk1" <dmytro_prokopchuk1@epam.com>,
	"Doug Goldstein" <cardoe@cardoe.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] misra: add deviation of Rule 17.7
Date: Tue, 26 Aug 2025 09:56:25 +0200	[thread overview]
Message-ID: <112a4ab83bf2abce09d4ff1b67671847@bugseng.com> (raw)
In-Reply-To: <204a1526-7e3f-4b91-b1ee-95f3d89ff756@suse.com>

On 2025-08-26 09:45, Jan Beulich wrote:
> On 26.08.2025 09:36, Dmytro Prokopchuk1 wrote:
>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> @@ -575,6 +575,11 @@ safe."
>>  -config=MC3A2.R17.7,calls+={safe, "any()", 
>> "decl(name(__builtin_memcpy||__builtin_memmove||__builtin_memset||cpumask_check))"}
>>  -doc_end
>> 
>> +-doc_begin="It is safe to deviate functions like 'memcpy()', 
>> 'memset()', 'memmove()', as they return a value purely for 
>> convenience,
>> +their primary functionality (memory manipulation) remains unaffected, 
>> and their return values are generally non-critical and seldom relied 
>> upon."
>> +-config=MC3A2.R17.7,calls+={safe, "any()", 
>> "decl(name(memcpy||memset||memmove))"}
>> +-doc_end
>> +
>>  #
>>  # Series 18.
>>  #
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -576,6 +576,13 @@ Deviations related to MISRA C:2012 Rules:
>>           - __builtin_memset()
>>           - cpumask_check()
>> 
>> +   * - R17.7
>> +     - It is safe to deviate functions like 'memcpy()', 'memset()', 
>> 'memmove()',
>> +       as they return a value purely for convenience, their primary 
>> functionality
>> +       (memory manipulation) remains unaffected, and their return 
>> values are
>> +       generally non-critical and seldom relied upon.
>> +     - Tagged as `safe` for ECLAIR.
> 
> I realize I may be overly nitpicky here, but in files named 
> deviations.* I find it
> odd to read "It is safe to deviate ...". I further find the use of 
> "like" odd when
> you enumerate the complete set anyway.
> 
> I wonder whether the deviation wants generalizing anyway: Informational 
> return
> values are generally okay to ignore. That is, the Eclair configuration 
> would be
> limited to the three functions for now, but the text / comment could 
> already be
> broader. Then, for example, open-coded uses of the corresponding 
> builtin functions
> would also be covered right away.
> 

While I understand the pragmatic reasoning, from a MISRA compliance 
standpoint it would be better not to make the written justification and 
the actual deviation diverge, and then wide both the ECLAIR 
configuration and its justification suitably once new cases want to be 
deviated. Other than that,

Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253


  parent reply	other threads:[~2025-08-26  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  7:36 [PATCH v2] misra: add deviation of Rule 17.7 Dmytro Prokopchuk1
2025-08-26  7:45 ` Jan Beulich
2025-08-26  7:53   ` Dmytro Prokopchuk1
2025-08-26  7:56   ` Nicola Vetrini [this message]
2025-08-26 13:14     ` Dmytro Prokopchuk1
2025-08-26 13:18       ` Nicola Vetrini

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=112a4ab83bf2abce09d4ff1b67671847@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=cardoe@cardoe.com \
    --cc=dmytro_prokopchuk1@epam.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --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.