]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/common: address violations of MISRA C:2012 Rule 11.8
authorMaria Celeste Cesario <maria.celeste.cesario@bugseng.com>
Tue, 19 Dec 2023 11:05:14 +0000 (12:05 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Dec 2023 10:47:50 +0000 (11:47 +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".

Change cast type from void* to uintptr_t.
void* type cast resulted in violation of the Rule, a cast to type uintptr_t
is more appropriate type-wise.

Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/version.c

index d32013520863dd01626f991f2bcada5741d980fc..e807ef4de0e6291ff40be72852ae30200e76ce4a 100644 (file)
@@ -178,7 +178,7 @@ void __init xen_build_init(void)
     if ( &n[1] >= __note_gnu_build_id_end )
         return;
 
-    sz = (void *)__note_gnu_build_id_end - (void *)n;
+    sz = (uintptr_t)__note_gnu_build_id_end - (uintptr_t)n;
 
     rc = xen_build_id_check(n, sz, &build_id_p, &build_id_len);