From patchwork Wed Nov 8 15:42:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13450264 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 24EE5C4332F for ; Wed, 8 Nov 2023 15:43:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.629337.981478 (Exim 4.92) (envelope-from ) id 1r0khb-0007AR-UH; Wed, 08 Nov 2023 15:42:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 629337.981478; Wed, 08 Nov 2023 15:42:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r0khb-0007AK-Rc; Wed, 08 Nov 2023 15:42:47 +0000 Received: by outflank-mailman (input) for mailman id 629337; Wed, 08 Nov 2023 15:42:46 +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 1r0kha-0007A8-BG for xen-devel@lists.xenproject.org; Wed, 08 Nov 2023 15:42:46 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7573c329-7e4d-11ee-98da-6d05b1d4d9a1; Wed, 08 Nov 2023 16:42:44 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.125.27]) by support.bugseng.com (Postfix) with ESMTPSA id 211C04EE0737; Wed, 8 Nov 2023 16:42:42 +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: 7573c329-7e4d-11ee-98da-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH v2] xen/arm: traps: address a violation of MISRA C:2012 Rule 8.2 Date: Wed, 8 Nov 2023 16:42:35 +0100 Message-Id: <24c2e8b7a7becc6b16d0b37f2c642a9b9e976269.1699457659.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Add missing parameter name "regs" and introduce function type bug_fn_t: this improves readability and helps to validate that the function passed to run_in_exception_handle() has the expected prototype. No functional change. Suggested-by: Julien Grall Signed-off-by: Federico Serafini --- Changes in v2: - adjusted tag; - avoided exceeding the 80-character limit. --- xen/arch/arm/traps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index ce89f16404..1264eab087 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1236,7 +1236,8 @@ int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc) if ( id == BUGFRAME_run_fn ) { - void (*fn)(const struct cpu_user_regs *) = (void *)regs->BUG_FN_REG; + typedef void (*bug_fn_t)(const struct cpu_user_regs *regs); + bug_fn_t fn = (void *)regs->BUG_FN_REG; fn(regs); return 0;