From patchwork Thu Dec 14 12:07:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13492946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97A61C4167B for ; Thu, 14 Dec 2023 12:09:01 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.654524.1021515 (Exim 4.92) (envelope-from ) id 1rDkWJ-0001sB-Fj; Thu, 14 Dec 2023 12:08:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 654524.1021515; Thu, 14 Dec 2023 12:08:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDkWJ-0001pJ-BU; Thu, 14 Dec 2023 12:08:51 +0000 Received: by outflank-mailman (input) for mailman id 654524; Thu, 14 Dec 2023 12:08:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDkWH-0000tI-KV for xen-devel@lists.xenproject.org; Thu, 14 Dec 2023 12:08:49 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8880a984-9a79-11ee-9b0f-b553b5be7939; Thu, 14 Dec 2023 13:08:46 +0100 (CET) Received: from beta.station (net-37-182-35-120.cust.vodafonedsl.it [37.182.35.120]) by support.bugseng.com (Postfix) with ESMTPSA id 3360D4EE0747; Thu, 14 Dec 2023 13:08:46 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8880a984-9a79-11ee-9b0f-b553b5be7939 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Maria Celeste Cesario , Jan Beulich , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , Simone Ballarin Subject: [PATCH 3/9] xen/efi: address violations of MISRA C:2012 Rule 11.8 Date: Thu, 14 Dec 2023 13:07:45 +0100 Message-Id: <4540a3850dae951dd6bc4f9b001c9816bde2e49e.1702555387.git.maria.celeste.cesario@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 From: Maria Celeste Cesario 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 Signed-off-by: Simone Ballarin Reviewed-by: Jan Beulich Reviewed-by: Stefano Stabellini --- xen/common/efi/boot.c | 6 +++--- xen/common/version.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 6110819918..efbec00af9 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -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 */ diff --git a/xen/common/version.c b/xen/common/version.c index d320135208..6ac5a52700 100644 --- a/xen/common/version.c +++ b/xen/common/version.c @@ -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 = (const void *)__note_gnu_build_id_end - (const void *)n; rc = xen_build_id_check(n, sz, &build_id_p, &build_id_len);