From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>,
Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
consulting@bugseng.com, "Roger Pau Monné" <roger.pau@citrix.com>,
"Wei Liu" <wl@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012 Rule 5.3
Date: Thu, 27 Jul 2023 16:00:09 +0100 [thread overview]
Message-ID: <40b2fb63-463c-2f9c-dc46-572cb0925807@citrix.com> (raw)
In-Reply-To: <604b915b-e07e-8985-87f1-300568d0259f@suse.com>
On 27/07/2023 3:50 pm, Jan Beulich wrote:
> On 27.07.2023 12:47, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>>
>> The renames done by this patch avoid shadowing from happening.
>> They are as follows:
>> - s/str/s/ in 'lapic_disable'
>> - s/str/level/ in '(apic|mce)_set_verbosity'
>> - s/str/state_str/ in 'mwait_idle_probe'
>> - s/str/memmap_name/ in 'init_e820'
> I'm sorry to say that, but I'm not willing to go and figure out where
> that "str" is that there's supposedly a collision with. Please can you
> state such right here, ...
>
>> - s/i/j/ in 'mce_action' (the shadowing here is due to macro
>> 'x86_mcinfo_lookup' that defines 'i' as a loop counter)
> ... much like you do in this case?
In fairness to Nicola, that was given.
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Function 'str' in 'xen/arch/x86/include/asm/desc.h'
> causes the shadowing.
which is the wrapper for the STR instruction.
It's used in a single assertion, and I'd be happy getting rid of it
entirely. Alternatively, it could be renamed to read_tr() (or
read_tr_sel() ?) if we want to keep the assertion.
We're not renaming every other use of 'str' to mean string just for this...
~Andrew
next prev parent reply other threads:[~2023-07-27 15:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 10:47 [XEN PATCH 0/4] address violations of MISRA C:2012 Rule 5.3 on x86 Nicola Vetrini
2023-07-27 10:45 ` [XEN PATCH 3/4] x86/mm: mechanically rename variable to avoid shadowing Nicola Vetrini
2023-07-27 10:48 ` Nicola Vetrini
2023-07-27 15:34 ` Jan Beulich
2023-07-27 10:47 ` [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012 Rule 5.3 Nicola Vetrini
2023-07-27 14:50 ` Jan Beulich
2023-07-27 15:00 ` Andrew Cooper [this message]
2023-07-27 15:18 ` Nicola Vetrini
2023-07-27 10:48 ` [XEN PATCH 2/4] x86/emulate: move a variable declaration " Nicola Vetrini
2023-07-27 15:06 ` Jan Beulich
2023-07-27 15:22 ` Nicola Vetrini
2023-07-27 15:31 ` Jan Beulich
2023-07-27 15:35 ` Nicola Vetrini
2023-07-27 10:48 ` [XEN PATCH 4/4] x86: avoid shadowing " Nicola Vetrini
2023-07-27 15:41 ` Jan Beulich
2023-07-27 15:58 ` Nicola Vetrini
2023-07-27 16:04 ` Jan Beulich
2023-07-27 10:48 ` [XEN PATCH 0/4] address violations of MISRA C:2012 Rule 5.3 on x86 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=40b2fb63-463c-2f9c-dc46-572cb0925807@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=consulting@bugseng.com \
--cc=jbeulich@suse.com \
--cc=michal.orzel@amd.com \
--cc=nicola.vetrini@bugseng.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.