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,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 3/5] x86: deviate violation of MISRA C Rule 20.12
Date: Fri, 07 Jun 2024 16:34:26 +0200	[thread overview]
Message-ID: <317aa87b389a8eb7de86853c7fc45829@bugseng.com> (raw)
In-Reply-To: <02262bd1-4d2f-413f-bc03-58c7181be216@suse.com>

On 2024-06-04 08:08, Jan Beulich wrote:
> On 01.06.2024 12:16, Nicola Vetrini wrote:
>> --- a/xen/arch/x86/include/asm/shared.h
>> +++ b/xen/arch/x86/include/asm/shared.h
>> @@ -76,6 +76,7 @@ static inline void arch_set_##field(struct vcpu *v,  
>>        \
>> 
>>  GET_SET_SHARED(unsigned long, max_pfn)
>>  GET_SET_SHARED(xen_pfn_t, pfn_to_mfn_frame_list_list)
>> +/* SAF-6-safe Rule 20.12: expansion of macro nmi_reason */
>>  GET_SET_SHARED(unsigned long, nmi_reason)
> 
> Before we go this route, were alternatives at least considered? Plus
> didn't we special-case function-like macros already, when used in
> situations where only object-like macros would be expanded anyway?
> 

It may be the case that this is already deviated, hence meaning that the 
patch can be dropped: I'll recheck.

In that case, thanks for pointing this out.

> As to alternatives: nmi_reason() is used in exactly one place.
> Dropping the #define and expanding the one use instead would be an
> option. I further wonder whether moving the #define-s past the
> piece of code you actually modify would also be an option (i.e. the
> tool then no longer complaining).
> 
> Jan

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


  reply	other threads:[~2024-06-07 14:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-01 10:16 [XEN PATCH 0/5] address violations of MISRA C rules Nicola Vetrini
2024-06-01 10:16 ` [XEN PATCH 1/5] xen/domain: deviate violation of MISRA C Rule 20.12 Nicola Vetrini
2024-06-03  6:39   ` Jan Beulich
2024-06-03 13:21     ` Nicola Vetrini
2024-06-01 10:16 ` [XEN PATCH 2/5] x86/domain: " Nicola Vetrini
2024-06-04  5:58   ` Jan Beulich
2024-06-01 10:16 ` [XEN PATCH 3/5] x86: " Nicola Vetrini
2024-06-04  6:08   ` Jan Beulich
2024-06-07 14:34     ` Nicola Vetrini [this message]
2024-06-01 10:16 ` [XEN PATCH 4/5] automation/eclair_analysis: address remaining violations " Nicola Vetrini
2024-06-03  5:58   ` Jan Beulich
2024-06-03  7:13     ` Nicola Vetrini
2024-06-03 18:52       ` Jan Beulich
2024-06-03 19:12         ` Nicola Vetrini
2024-06-03 21:24           ` Jan Beulich
2024-06-03 21:37             ` Nicola Vetrini
2024-06-20  1:28   ` Stefano Stabellini
2024-06-01 10:16 ` [XEN PATCH 5/5] xen: fix MISRA regressions on rule 20.9 and 20.12 Nicola Vetrini
2024-06-01 12:47   ` Andrew Cooper
2024-06-01 12:58     ` Nicola Vetrini
2024-06-01 13:08       ` Andrew Cooper
2024-06-01 13:52         ` Nicola Vetrini
2024-06-01 14:01           ` Andrew Cooper
2024-06-01 14:37 ` [XEN PATCH 0/5] address violations of MISRA C rules Andrew Cooper
2024-06-01 17:19   ` Nicola Vetrini
2024-06-01 17:22     ` Andrew Cooper

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=317aa87b389a8eb7de86853c7fc45829@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=consulting@bugseng.com \
    --cc=jbeulich@suse.com \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.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.