[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH v2 1/3] xen/common: address MISRA C:2012 Rule 5.3
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
- Date: Tue, 01 Aug 2023 15:39:47 +0200
- Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 01 Aug 2023 13:39:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 01/08/2023 15:33, Jan Beulich wrote:
On 01.08.2023 14:47, Nicola Vetrini wrote:
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -81,6 +81,7 @@ int compat_memory_op(unsigned int cmd,
XEN_GUEST_HANDLE_PARAM(void) compat)
struct compat_memory_exchange xchg;
struct compat_add_to_physmap atp;
struct compat_add_to_physmap_batch atpb;
+ struct compat_remove_from_physmap rmfp;
struct compat_vnuma_topology_info vnuma;
struct compat_mem_access_op mao;
struct compat_mem_acquire_resource mar;
@@ -321,12 +322,10 @@ int compat_memory_op(unsigned int cmd,
XEN_GUEST_HANDLE_PARAM(void) compat)
case XENMEM_remove_from_physmap:
{
- struct compat_remove_from_physmap cmp;
-
- if ( copy_from_guest(&cmp, compat, 1) )
+ if ( copy_from_guest(&cmp.rmfp, compat, 1) )
return -EFAULT;
- XLAT_remove_from_physmap(nat.xrfp, &cmp);
+ XLAT_remove_from_physmap(nat.xrfp, &cmp.rmfp);
Is there a reason not to use the same name in the compat union as is
used in the native one, like all other members do?
No, I just didn't notice there was a native remove_from_physmap field
when choosing the name.
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
|