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 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3
Date: Mon, 07 Aug 2023 13:12:16 +0200 [thread overview]
Message-ID: <871a501fb76cff724ed1c2b09277e2a3@bugseng.com> (raw)
In-Reply-To: <742f4a4a-5938-82f5-7e76-1189a2519063@suse.com>
>> Besides the one you listed, there are these other occurrences:
>> - xen/arch/x86/mm.c:4678 in 'arch_memory_op' as local variable 'struct
>> e820entry'
>
> This probably wants renaming; my suggestion would be just "e" here.
Ok
>
>> - xen/arch/x86/include/asm/guest/hypervisor.h:55 in
>> 'hypervisor_e820_fixup'
>> - xen/arch/x86/include/asm/pv/shim.h:88 in 'pv_shim_fixup'
>
> These can likely again have their parameters dropped, for it only
> ever being the "e820" global which is passed. (Really I think in such
> cases the names being the same should be permitted.)
>
>> - xen/arch/x86/setup.c:689 in 'kexec_reserve_area'
>
> This surely can quite sensibly have boot_e820 use moved into the
> function itself.
>
Ok, although your suggestion of breaking these renames/deletions in more
than one patch may not be applicable,
as 'kexec_reserve_area' calls 'reserve_e820_ram', which in turn calls
'e820_change_range_type'.
Similarly, the call stack containing 'e820_add_range' includes other
calls to the modified functions, so
effectively it's best to drop the parameter everywhere all at once to
prevent accidental mistakes.
>> We can take the first approach you suggested (which was my original
>> attempt, but then upon feedback on other
>> patches I reworked this patch before submitting). My doubt about it
>> was
>> that it would introduce a naming
>> inconsistency with other e820-related objects/types. Anyway, if
>> e820_map
>> is not a good name, could e820_arr be it?
>
> But how does "arr" describe the purpose? I would have suggested a name,
> but none I can think of (e820_real, e820_final) I'd be really happy
> with.
> Just e820 is pretty likely the best name we can have here.
>
Ok, so perhaps the best way is using the strategy above, although I'm
curious why in other places this
was not the preferred alternative (as the global may be dropped or the
callers may use a e820map other
than the global one, but here I recognize my lack of knowledge on the
internals of Xen).
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-08-07 11:17 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 15:27 [XEN PATCH 0/6] xen: address MISRA C:2012 Rule 5.3 Nicola Vetrini
2023-08-04 15:27 ` [XEN PATCH 1/6] x86: rename variable 'e820' to " Nicola Vetrini
2023-08-04 21:19 ` Stefano Stabellini
2023-08-07 7:14 ` Nicola Vetrini
2023-08-07 8:09 ` Jan Beulich
2023-08-07 8:59 ` Nicola Vetrini
2023-08-07 9:10 ` Jan Beulich
2023-08-07 11:12 ` Nicola Vetrini [this message]
2023-08-07 12:02 ` Jan Beulich
2023-08-08 7:08 ` Nicola Vetrini
2023-08-08 7:21 ` Jan Beulich
2023-08-08 21:21 ` Stefano Stabellini
2023-08-08 21:24 ` Stefano Stabellini
2023-08-07 15:03 ` Nicola Vetrini
2023-08-07 15:07 ` Jan Beulich
2023-08-07 18:39 ` Stefano Stabellini
2023-08-04 15:27 ` [XEN PATCH 2/6] libelf: " Nicola Vetrini
2023-08-04 21:21 ` Stefano Stabellini
2023-08-07 8:11 ` Jan Beulich
2023-08-07 9:03 ` Nicola Vetrini
2023-08-04 15:27 ` [XEN PATCH 3/6] xen/delay: " Nicola Vetrini
2023-08-04 21:23 ` Stefano Stabellini
2023-08-07 8:14 ` Jan Beulich
2023-08-07 9:01 ` Julien Grall
2023-08-07 9:15 ` Jan Beulich
2023-08-07 9:23 ` Nicola Vetrini
2023-08-07 9:32 ` Jan Beulich
2023-08-07 9:33 ` Julien Grall
2023-08-04 15:27 ` [XEN PATCH 4/6] x86/include: " Nicola Vetrini
2023-08-04 21:24 ` Stefano Stabellini
2023-08-07 7:16 ` Nicola Vetrini
2023-08-04 15:27 ` [XEN PATCH 5/6] x86/xstate: " Nicola Vetrini
2023-08-04 21:26 ` Stefano Stabellini
2023-08-07 8:23 ` Jan Beulich
2023-08-07 9:20 ` Nicola Vetrini
2023-08-04 15:27 ` [XEN PATCH 6/6] x86: refactor macros in 'xen-mca.h' to " Nicola Vetrini
2023-08-04 15:38 ` Nicola Vetrini
2023-08-04 21:30 ` Stefano Stabellini
2023-08-07 8:31 ` Jan Beulich
2023-08-07 10:01 ` 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=871a501fb76cff724ed1c2b09277e2a3@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.