]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/efi: address violations of MISRA C:2012 Rule 11.8
authorMaria Celeste Cesario <maria.celeste.cesario@bugseng.com>
Mon, 18 Dec 2023 14:21:17 +0000 (15:21 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Dec 2023 14:21:17 +0000 (15:21 +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".

Add missing const qualifiers in casts.
The variables are originally const-qualified.
There's no reason to drop the qualifiers.

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>
xen/common/efi/boot.c

index 61108199188f10d9e015ae66e1d454dd7722a24d..efbec00af9dadf365bb038930d7fd0fb1e4c3b41 100644 (file)
@@ -1248,10 +1248,10 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste
 #endif
 
     /* Adjust pointers into EFI. */
-    efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
-    efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START;
+    efi_ct = (const void *)efi_ct + DIRECTMAP_VIRT_START;
+    efi_rs = (const void *)efi_rs + DIRECTMAP_VIRT_START;
     efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
-    efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
+    efi_fw_vendor = (const void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
 }
 
 /* SAF-1-safe */