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>, "Wei Liu" <wl@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v3 1/2] x86/vmsi: rename variables to address MISRA C:2012 Rule 5.3
Date: Tue, 08 Aug 2023 15:38:18 +0200 [thread overview]
Message-ID: <e86dc812f4e365d8f23a14f9edcc2852@bugseng.com> (raw)
In-Reply-To: <9e5f208e-7419-b16d-c705-592959dc0ea1@suse.com>
On 08/08/2023 15:22, Jan Beulich wrote:
> On 08.08.2023 14:22, Nicola Vetrini wrote:
>> The local variables 'irq_desc' shadow the homonymous global variable,
>> declared in 'xen/arch/x86/include/asm/irq.h', therefore they are
>> renamed
>> 'irqd' for consistency with ARM code. Other variables of the same type
>> in the file are also renamed 'irqd' for consistency.
>
> I'm pretty sure I pointed out that Arm uses a mix of "desc" and "irqd".
> So "consistency with ARM code" doesn't ...
>
>> --- a/xen/arch/x86/hvm/vmsi.c
>> +++ b/xen/arch/x86/hvm/vmsi.c
>> @@ -281,7 +281,7 @@ static int msixtbl_write(struct vcpu *v, unsigned
>> long address,
>> unsigned int nr_entry, index;
>> int r = X86EMUL_UNHANDLEABLE;
>> unsigned long flags;
>> - struct irq_desc *desc;
>> + struct irq_desc *irqd;
>
> ... require e.g. this rename. As mentioned before: Let's limit code
> churn where possible, and where going beyond what's strictly necessary
> isn't otherwise useful; there's already enough of it with all these not
> really helpful Misra changes.
>
>> @@ -462,7 +462,7 @@ static void del_msixtbl_entry(struct msixtbl_entry
>> *entry)
>>
>> int msixtbl_pt_register(struct domain *d, struct pirq *pirq, uint64_t
>> gtable)
>> {
>> - struct irq_desc *irq_desc;
>> + struct irq_desc *irqd;
>
> This one indeed wants renaming, but then - consistent within the file -
> to "desc". At least that's my view.
>
> Jan
Well, but having
struct irq_desc *desc;
struct msi_desc *msi_desc;
and then using them both within the function doesn't seem that readable,
but if you
prefer "desc" I have no objection (just two local variables that need to
be changed).
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-08-08 13:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 12:22 [XEN PATCH v3 0/2] x86: address MISRA C:2012 Rule 5.3 and 8.3 Nicola Vetrini
2023-08-08 12:22 ` [XEN PATCH v3 1/2] x86/vmsi: rename variables to address MISRA C:2012 Rule 5.3 Nicola Vetrini
2023-08-08 13:22 ` Jan Beulich
2023-08-08 13:38 ` Nicola Vetrini [this message]
2023-08-08 13:52 ` Jan Beulich
2023-08-08 13:55 ` Nicola Vetrini
2023-08-08 12:22 ` [XEN PATCH v3 2/2] x86/setup: address MISRA C:2012 Rule 5.3 and 8.3 Nicola Vetrini
2023-08-08 13:27 ` 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=e86dc812f4e365d8f23a14f9edcc2852@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=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.