All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
	xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
	consulting@bugseng.com, bertrand.marquis@arm.com, julien@xen.org,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2] xen/compiler: deviate the inline macro for MISRA C Rule 20.4
Date: Tue, 12 Mar 2024 12:36:00 +0100	[thread overview]
Message-ID: <8dca7b5f7fc564ddbd4a4e97bc9ae5ca@bugseng.com> (raw)
In-Reply-To: <cf13d0d3-ac5a-483c-956b-12dad7af9cc8@suse.com>

On 2024-03-12 12:25, Jan Beulich wrote:
> On 12.03.2024 12:13, Nicola Vetrini wrote:
>> Rule 20.4 states: "A macro shall not be defined with the same name
>> as a keyword".
>> 
>> Defining this macro with the same name as the inline keyword
>> allows for additionally checking that out-of-lined static inline
>> functions end up in the correct section while minimizing churn and
>> has a positive impact on the overall safety. See [1] for additional
>> context on the motivation of this deviation.
>> 
>> No functional change.
>> 
>> [1] 
>> https://lore.kernel.org/xen-devel/adaa6d55-266d-4df8-8967-9340080d17e4@citrix.com/
>> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> with ...
> 
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -322,6 +322,12 @@ Deviations related to MISRA C:2012 Rules:
>>           - /\* Fallthrough \*/
>>           - /\* Fallthrough. \*/
>> 
>> +   * - R20.4
>> +     -  The override of the keyword \"inline\" in xen/compiler.h is 
>> present so
>> +        that section contents checks pass when the compiler chooses 
>> not to
>> +        inline a particular function.
> 
> ... padding (1st line of this bullet point) and indentation (2nd and 
> 3rd
> lines) adjusted to what's used elsewhere, including e.g ...
> 

Yeah, sorry.

>> +     - Comment-based deviation.
>> +
>>     * - R20.7
>>       - Code violating Rule 20.7 is safe when macro parameters are 
>> used:
>>         (1) as function arguments;
> 
> ... here. Happy to do so while committing.
> 

Thanks,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


      reply	other threads:[~2024-03-12 11:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 11:13 [XEN PATCH v2] xen/compiler: deviate the inline macro for MISRA C Rule 20.4 Nicola Vetrini
2024-03-12 11:25 ` Jan Beulich
2024-03-12 11:36   ` Nicola Vetrini [this message]

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=8dca7b5f7fc564ddbd4a4e97bc9ae5ca@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=bertrand.marquis@arm.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xenia.ragiadakou@amd.com \
    /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.