All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "Dmytro Prokopchuk1" <dmytro_prokopchuk1@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [XEN PATCH 3/5] x86/irq: address violation of MISRA C Rule 5.5
Date: Tue, 8 Jul 2025 09:29:07 +0200	[thread overview]
Message-ID: <961d2f58-a5c5-445f-ba76-e9d082c182ae@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2507071422160.605088@ubuntu-linux-20-04-desktop>

On 07.07.2025 23:25, Stefano Stabellini wrote:
> On Mon, 7 Jul 2025, Jan Beulich wrote:
>> On 04.07.2025 22:39, Dmytro Prokopchuk1 wrote:
>>> Address a violation of MISRA C:2012 Rule 5.5:
>>> "Identifiers shall be distinct from macro names".
>>>
>>> Reports for service MC3A2.R5.5:
>>> xen/include/xen/irq.h: non-compliant function `pirq_cleanup_check(struct pirq*, struct domain*)'
>>> xen/include/xen/irq.h: non-compliant macro `pirq_cleanup_check'
>>>
>>> The primary issue stems from the macro and function
>>> having identical names, which is confusing and
>>> non-compliant with common coding standards.
>>>
>>> Change the function name by adding two underscores at the end.
>>>
>>> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
>>
>> I'm not going to NAK this, but I dislike the transformation done. The aliasing
>> in this case was intentional, to avoid any caller appearing that would bypass
>> the macro. Yes, the double underscores will also stand out (as much as the
>> parenthesization that would have been needed to override the protection), but
>> still ...
> 
> Maybe you can suggest a different name?

As per my earlier reply, using the same name was intentional here. Hence
it's not a matter of what (different) name to pick, but the mere fact that
a different name is being suggested to be used. Yet as said - I'm not
going to NAK this, but I also don't like the change.

Jan

> Looking at the diff, this patch also seems OKish.
> 
> It is possible but difficult to deviate specific instances like this: if
> a SAF in-code comment works, then great, otherwise we have to resort to
> a regex which makes thing harder to maintain.
> 
> Unless a SAF in-code comment works, I think this patch is the best way
> to go.



  reply	other threads:[~2025-07-08  7:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 20:39 [XEN PATCH 0/5] address violation of MISRA C Rule 5.5 Dmytro Prokopchuk1
2025-07-04 20:39 ` [XEN PATCH 1/5] gnttab: " Dmytro Prokopchuk1
2025-07-07 21:28   ` Stefano Stabellini
2025-07-04 20:39 ` [XEN PATCH 2/5] iommu: " Dmytro Prokopchuk1
2025-07-07  8:10   ` Jan Beulich
2025-07-07 21:21     ` Stefano Stabellini
2025-07-08  7:27       ` Jan Beulich
2025-07-04 20:39 ` [XEN PATCH 3/5] x86/irq: " Dmytro Prokopchuk1
2025-07-07  8:15   ` Jan Beulich
2025-07-07 21:25     ` Stefano Stabellini
2025-07-08  7:29       ` Jan Beulich [this message]
2025-07-04 20:39 ` [XEN PATCH 4/5] device-tree: " Dmytro Prokopchuk1
2025-07-07 21:29   ` Stefano Stabellini
2025-07-04 20:39 ` [XEN PATCH 5/5] xen/bitops: " Dmytro Prokopchuk1
2025-07-07 21:34   ` Stefano Stabellini
2025-07-04 21:12 ` [XEN PATCH 0/5] " Dmytro Prokopchuk1

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=961d2f58-a5c5-445f-ba76-e9d082c182ae@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dmytro_prokopchuk1@epam.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.