From nobody Sun Dec 22 17:24:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1728311332; cv=none; d=zohomail.com; s=zohoarc; b=KTDMIgvzjKBBiavjwg6o8UNjTbnWEb5ksEFLdKyCTXXCUr/RJAeSWbNs5uiuuclOraHqHddDZC8prhRh2uL1ushPX5OpJU5mkMl+WGuoF+AHPjTcthOjtDW4bmjJB4nk9ymfmsU6Ef5bJYYvf3tR9C4jCOERzwYbeb+3+HEyHGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728311332; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o4fXXbJ2KFThlr/L+QGgLqMmLIiCOxjDoAsZZyepK8Y=; b=P+q0LkHt0XZoag6O+O9rlszYbU79P7vM+fRPeivxvp/+2nublkk9o0hkTb/8r3XUyivZM36gIZy6uwluHiyuxGYzdytyfx8wCsOojuEQDDlSeMULSDqZ/7Hgymuuok6onQ9/sGk9qcnRSi6FVYSm8lPOvDXaZKYI4o3qGYIgiys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1728311332539786.679588077263; Mon, 7 Oct 2024 07:28:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812092.1224812 (Exim 4.92) (envelope-from ) id 1sxoiy-0002YQ-Be; Mon, 07 Oct 2024 14:28:36 +0000 Received: by outflank-mailman (output) from mailman id 812092.1224812; Mon, 07 Oct 2024 14:28:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxoiy-0002YB-5T; Mon, 07 Oct 2024 14:28:36 +0000 Received: by outflank-mailman (input) for mailman id 812092; Mon, 07 Oct 2024 14:28:35 +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 1sxoXL-0002yM-TY for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:35 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c25ca249-84b6-11ef-a0bb-8be0dac302b0; Mon, 07 Oct 2024 16:16:35 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.162.58.49]) by support.bugseng.com (Postfix) with ESMTPSA id D37314EE0745; Mon, 7 Oct 2024 16:16:33 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: c25ca249-84b6-11ef-a0bb-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1728310595; bh=bPGNGs/7gKws9KC4a8OFYQw2+N/QcDxZjIxN7dUNgMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNh/5lISmIQ1gmhVCXsh3Ez15sbICvQAm7ysmvf676GQzNBIlv2V2aSe2xHDGo4sP wpMcgMFqQnALlSIk2QY9IIUG/O/+o7g8lL1lQjw4EdlaTtR+h1pEWtZFmMlpOiitUe ihO3ihs9V3gfIXk4jPbloTuP45zJ+Nz+bmCPE6keWYqjmGBlQHMzu9jX7WKKj1hw9W 7Jxnt4WVAeh0EG3Az1cmMGCqfGi5DGFoD1sygqxPloAbZtZZzTVEE8DaHBCeOzn5WT lNeJNlRFbF8UuGpFzvDqgt3pOWIXySZzTCl9/+3IsSxKovXJMrJabk0nXwUwK2PVZL ivq6qW/m4a2Yg== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v2 2/4] x86/emul: address violations of MISRA C Rule 16.3 Date: Mon, 7 Oct 2024 16:16:17 +0200 Message-ID: <662440bc082fcb91ad9489999add02fc71416d45.1728308312.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1728311332906116600 Content-Type: text/plain; charset="utf-8" Add missing break statements to address violations of MISRA C:2012 Rule 16.3 (An unconditional `break' statement shall terminate every switch-clause). Make explicit unreachability of a program points with ASSERT_UNREACHABLE(). No functional change. Signed-off-by: Federico Serafini --- Changes in v2: - unreachability made explicit. --- xen/arch/x86/x86_emulate/fpu.c | 5 +++++ xen/arch/x86/x86_emulate/x86_emulate.c | 1 + 2 files changed, 6 insertions(+) diff --git a/xen/arch/x86/x86_emulate/fpu.c b/xen/arch/x86/x86_emulate/fpu.c index 480d879657..f0dab346e0 100644 --- a/xen/arch/x86/x86_emulate/fpu.c +++ b/xen/arch/x86/x86_emulate/fpu.c @@ -218,6 +218,7 @@ int x86emul_fpu(struct x86_emulate_state *s, */ if ( dst->type =3D=3D OP_MEM && !s->fpu_ctrl && !fpu_check_wri= te() ) dst->type =3D OP_NONE; + break; } break; =20 @@ -296,6 +297,7 @@ int x86emul_fpu(struct x86_emulate_state *s, default: generate_exception(X86_EXC_UD); } + break; } break; =20 @@ -386,6 +388,7 @@ int x86emul_fpu(struct x86_emulate_state *s, */ if ( dst->type =3D=3D OP_MEM && !s->fpu_ctrl && !fpu_check_wri= te() ) dst->type =3D OP_NONE; + break; } break; =20 @@ -457,6 +460,8 @@ int x86emul_fpu(struct x86_emulate_state *s, case 7: /* fistp m64i */ goto fpu_memdst64; } + ASSERT_UNREACHABLE(); + break; } break; =20 diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emul= ate/x86_emulate.c index 6b6b8c8fe4..30674ec301 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -8310,6 +8310,7 @@ x86_emulate( } if ( rc !=3D 0 ) goto done; + break; default: break; } --=20 2.43.0