From patchwork Thu Dec 14 12:07:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13492955 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 ACB9EC4167B for ; Thu, 14 Dec 2023 12:09:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.654523.1021507 (Exim 4.92) (envelope-from ) id 1rDkWI-0001Yl-QR; Thu, 14 Dec 2023 12:08:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 654523.1021507; Thu, 14 Dec 2023 12:08:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDkWI-0001Wq-GK; Thu, 14 Dec 2023 12:08:50 +0000 Received: by outflank-mailman (input) for mailman id 654523; Thu, 14 Dec 2023 12:08:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rDkWH-0000tC-BT 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-sth1.inumbo.com (Halon) with ESMTPS id 896fae79-9a79-11ee-98e9-6d05b1d4d9a1; Thu, 14 Dec 2023 13:08:48 +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 CEBE34EE0C8D; Thu, 14 Dec 2023 13:08:47 +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: 896fae79-9a79-11ee-98e9-6d05b1d4d9a1 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Maria Celeste Cesario , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Simone Ballarin Subject: [PATCH 7/9] x86/hvm: address violations of MISRA C:2012 Rule 11.8 Date: Thu, 14 Dec 2023 13:07:49 +0100 Message-Id: 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". 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 Signed-off-by: Simone Ballarin Reviewed-by: Jan Beulich Reviewed-by: Stefano Stabellini --- xen/arch/x86/hvm/hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 35a30df3b1..523e0df57c 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -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 */ }