From patchwork Tue Dec 19 11:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13498163 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 DA746C46CD4 for ; Tue, 19 Dec 2023 11:06:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.656669.1025039 (Exim 4.92) (envelope-from ) id 1rFXvR-0004Ln-2B; Tue, 19 Dec 2023 11:06:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 656669.1025039; Tue, 19 Dec 2023 11:06:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFXvQ-0004KT-Tc; Tue, 19 Dec 2023 11:06:12 +0000 Received: by outflank-mailman (input) for mailman id 656669; Tue, 19 Dec 2023 11:06:11 +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 1rFXvP-0003cc-4X for xen-devel@lists.xenproject.org; Tue, 19 Dec 2023 11:06:11 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9d234269-9e5e-11ee-9b0f-b553b5be7939; Tue, 19 Dec 2023 12:06:09 +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 DBB564EE0C96; Tue, 19 Dec 2023 12:06:08 +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: 9d234269-9e5e-11ee-9b0f-b553b5be7939 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Maria Celeste Cesario , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Simone Ballarin Subject: [PATCH v2 5/6] xen: remove unused function ERR_CAST Date: Tue, 19 Dec 2023 12:05:13 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 From: Maria Celeste Cesario Function ERR_CAST contains a violation 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". Since the function has no users, it is appropriate to remove it. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- Commit introduced in v2. --- xen/include/xen/err.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/xen/include/xen/err.h b/xen/include/xen/err.h index 2f29b57d28..cbdd1bf7f8 100644 --- a/xen/include/xen/err.h +++ b/xen/include/xen/err.h @@ -36,19 +36,6 @@ static inline long __must_check IS_ERR_OR_NULL(const void *ptr) return !ptr || IS_ERR_VALUE((unsigned long)ptr); } -/** - * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type - * @ptr: The pointer to cast. - * - * Explicitly cast an error-valued pointer to another pointer type in such a - * way as to make it clear that's what's going on. - */ -static inline void * __must_check ERR_CAST(const void *ptr) -{ - /* cast away the const */ - return (void *)ptr; -} - static inline int __must_check PTR_RET(const void *ptr) { return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;