]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/hvm: address a violation of MISRA C:2012 Rule 11.8
authorMaria Celeste Cesario <maria.celeste.cesario@bugseng.com>
Mon, 18 Dec 2023 14:22:06 +0000 (15:22 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Dec 2023 14:22:06 +0000 (15:22 +0100)
The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
headline states:
"A conversion shall not remove any const, volatile or _Atomic qualification
from the type pointed to by a pointer".

Remove unnecessary cast.
from is a const-qualified pointer to void and the function hvm_copy_to_guest_linear
requires a const void* type argument, therefore the cast to void* is not necessary.

No functional change.

Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/x86/hvm/hvm.c

index 35a30df3b1b49e3514bd97104c9f11bed1c739a5..523e0df57c80fea92656d2097d90b094230b6c61 100644 (file)
@@ -3462,7 +3462,7 @@ unsigned int copy_to_user_hvm(void *to, const void *from, unsigned int len)
         return 0;
     }
 
-    rc = hvm_copy_to_guest_linear((unsigned long)to, (void *)from, len, 0, NULL);
+    rc = hvm_copy_to_guest_linear((unsigned long)to, from, len, 0, NULL);
     return rc ? len : 0; /* fake a copy_to_user() return code */
 }