From nobody Sun Dec 22 11:43:05 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=1728311384; cv=none; d=zohomail.com; s=zohoarc; b=i/2H4HfHYBomTDGcENhe8WXcJSC7YpPKi4LQ7DTnsAi8W7X/ugdcIP0aJsTvCGKTrkT4JZTsOPqdBdZYyA3g9umwPzx2Ta/ML7+I8EjOmQLFeNHgOGg2ZTSsDgIXESzyhM57p4byzLm3U+0ycZoRMDNm4aIWG9F98QBMR0GlgB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728311384; 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=Sb63wGxF5l/JLzmvq9+43G4p2T0xEoe4JnuEQCqdI2E=; b=ITUJ+hs+xtVJfZoKIAXOWAA32zYVSSyv5zyKcYJeIrsDEImDAHQITK+GLb8uZ60xitmdC4q50PMp8Ofu05XBBcB522cHUlwlw2a9BqwBOTsdN1Su8C1tPMiBVIp0oQZJRDlhgejUeKMcd49RrMU/Hac+X1jwQ98V/S9P3L9GMnk= 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 1728311384506680.9753621166249; Mon, 7 Oct 2024 07:29:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812105.1224820 (Exim 4.92) (envelope-from ) id 1sxojj-0004OG-Hj; Mon, 07 Oct 2024 14:29:23 +0000 Received: by outflank-mailman (output) from mailman id 812105.1224820; Mon, 07 Oct 2024 14:29:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxojj-0004O9-Ej; Mon, 07 Oct 2024 14:29:23 +0000 Received: by outflank-mailman (input) for mailman id 812105; Mon, 07 Oct 2024 14:29:22 +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 1sxoXM-0002dC-8D for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:36 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c16f7f91-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:16:33 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.162.58.49]) by support.bugseng.com (Postfix) with ESMTPSA id ACA1E4EE0743; Mon, 7 Oct 2024 16:16:32 +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: c16f7f91-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1728310593; bh=pkehAqIigHugA14oiN/kSXZIjXGX6ygiIRmSA9aEPl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNsLZMClLCIOP+iP8GcTHaCg58dgwWfkO4r+WhG5ZXUvUN0XFBIc1ScaaIwfzRhfL /odxlPhj6dvIpEFtVIF20a88aIPFblEWcM9g0rkadhHOmkTB3USqkpTDp7NgUBeY98 MTLbB+0j3XluWB88FxHjz3xVp9fqLMQ6qyJPvbUu7PfiJqqityPafRMrZwu69ubTxE lIKwmy0JRR7Zzllp5I0yEmMUAevmpLiiC+TE4zq4Eu2Dx2CAwQheVCtNXeVZxWiLG0 152/2bXWyuG0avdiQDhlCSmOm7vhz6e0TVYB7cN0QiwA2KjZmGXLJRqaomAEafzt7V iRuv3ufAY364Q== 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 1/4] x86/emul: add defensive code Date: Mon, 7 Oct 2024 16:16:16 +0200 Message-ID: <063bd71b535825715bd54ee9238bec2fc87f0bba.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: 1728311385117116600 Content-Type: text/plain; charset="utf-8" Add defensive code after unreachable program points. This also meets the requirements to deviate violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- Changes in v2: - use goto unhandleable. --- xen/arch/x86/x86_emulate/x86_emulate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emul= ate/x86_emulate.c index 0ea0d5e67e..6b6b8c8fe4 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -6840,6 +6840,7 @@ x86_emulate( break; default: ASSERT_UNREACHABLE(); + goto unhandleable; } break; #ifdef HAVE_AS_SSE4_2 @@ -6868,6 +6869,7 @@ x86_emulate( # endif default: ASSERT_UNREACHABLE(); + goto unhandleable; } break; #endif --=20 2.43.0 From nobody Sun Dec 22 11:43:05 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 From nobody Sun Dec 22 11:43:05 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=1728311397; cv=none; d=zohomail.com; s=zohoarc; b=N4J8ZCTNZab6omniJa74MgQ3VpsRL4PVy/oON5934ZIwIVkt+FO2ryMDfhcqQC9Ts8dTNYacP/wv1RC9srCGwkuAm1UtXsg/XCjnPw6xGk+fp5zHT5ZjkaJo3paR45zOgD9TFbypVf3/efA8umR50VHpSCghI8l/rlW8dubUfyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728311397; 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=adc4fSGnpAYXCpU3ca4g+d4W8voT6p/4n3IwdSeDzdU=; b=VVOGzfiwE5Qp2STGXj8vc3dSPbcN56p6je/w7rtaeh2aJltCF0s0+bhtW8x4iLPeOuLwUCD5GLFsLoechkZkSaytr12cQcNdTNXk4Cw+yZlIgquL7+TpuAC9kVgtqAcPypYytD2Xx6HkhNzbkX4ASex4G34XyEhNwHPKAFs87v0= 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 1728311397711310.6503531794492; Mon, 7 Oct 2024 07:29:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812107.1224831 (Exim 4.92) (envelope-from ) id 1sxojy-00056T-Tf; Mon, 07 Oct 2024 14:29:38 +0000 Received: by outflank-mailman (output) from mailman id 812107.1224831; Mon, 07 Oct 2024 14:29:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxojy-00055m-Qj; Mon, 07 Oct 2024 14:29:38 +0000 Received: by outflank-mailman (input) for mailman id 812107; Mon, 07 Oct 2024 14:29:37 +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 1sxoXO-0002dC-IW for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:38 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c2f69c14-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:16:36 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.162.58.49]) by support.bugseng.com (Postfix) with ESMTPSA id 67D704EE0746; Mon, 7 Oct 2024 16:16:35 +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: c2f69c14-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1728310596; bh=E7dB2FCofs9MFp7zihxh1wxnARDyNN7WgWI2FwQOK0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xVPGjM9WjmZpi8GG7K9MaKDBHZwteFI3oEC0yibwshSbIA5MxmazJ2nlmAPH8z8XV ydBaf+FQ3AAfT6hfAwEp+ksKFO0j3UVtrKrGnAda5JHB1CZ95YQ3HUS/3Q1OZ2nTxQ H8syHKDPHxjy1fQyO5r4zkGDoCtrIXjXLuLv8lw5Kczd1hIT4IKijqL9g9v9qI11gI +qEtVlpB+dKouWU80A4wXuR4lR6tr4lT2lzuSLkIu6ghEwCTary4FKkxx9+cdLJx3x CXMSp0RmQwR08y0eiH6H9A5HEKEw+OjqeWqpyEo39l4OUfYP5eQLpvAWdO2oIA/i1I 0gH2S1Owz3nLA== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v2 3/4] xen/vpci: address violations of MISRA C Rule 16.3 Date: Mon, 7 Oct 2024 16:16:18 +0200 Message-ID: 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: 1728311399158116600 Content-Type: text/plain; charset="utf-8" Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Roger Pau Monn=C3=A9 --- Changes from v2: - simply break without returning X86EMUL_UNHANDLEABLE. As pointed out by Jan, these functions only return X86EMUL_OKAY but: https://lists.xenproject.org/archives/html/xen-devel/2024-09/msg00727.html Do you have any comments? --- xen/drivers/vpci/msix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c index fbe710ab92..5bb4444ce2 100644 --- a/xen/drivers/vpci/msix.c +++ b/xen/drivers/vpci/msix.c @@ -364,6 +364,7 @@ static int adjacent_read(const struct domain *d, const = struct vpci_msix *msix, =20 default: ASSERT_UNREACHABLE(); + break; } spin_unlock(&vpci->lock); =20 @@ -512,6 +513,7 @@ static int adjacent_write(const struct domain *d, const= struct vpci_msix *msix, =20 default: ASSERT_UNREACHABLE(); + break; } spin_unlock(&vpci->lock); =20 --=20 2.43.0 From nobody Sun Dec 22 11:43:05 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=1728311213; cv=none; d=zohomail.com; s=zohoarc; b=IQls7yv8rW4+9zauRHAtWzf3XbPuGRwpct74W77WlIZw7qNc24YiMirg+jZb3wlwg6ZNcgGjDdeEeGJa2Vuaqh+hNCjujwETn/wjfsVGUJQW5vX1t0L0YVCMbj8okoiOmC8wVNw8tIZpX1qxffGwgh+YKtM0hixzbyU0MzZUP1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728311213; 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=v54KLPtLMvcqWm3YNsp8a3Ay+wz8gSmemBwKG/1fFyw=; b=XI0z5j+1ZVcBFasajKPurSFeIRZPsUelKhedd1Fx0PKe6wpNtK2FdOMTnPGQfqiW8ICvTM6KDQHrN3Jpsc8skFgulhg647GE8R95/waNotMS2U4d2hMN856pOnry9jb+GFtY6HUBt26ZPsxwHnAzs5kYsFZFJIbdqbZdhoPslBs= 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 1728311213774615.5048396109596; Mon, 7 Oct 2024 07:26:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812062.1224770 (Exim 4.92) (envelope-from ) id 1sxogs-0005Z4-8C; Mon, 07 Oct 2024 14:26:26 +0000 Received: by outflank-mailman (output) from mailman id 812062.1224770; Mon, 07 Oct 2024 14:26:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxogs-0005Yx-5i; Mon, 07 Oct 2024 14:26:26 +0000 Received: by outflank-mailman (input) for mailman id 812062; Mon, 07 Oct 2024 14:26:25 +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 1sxoXO-0002yM-3E for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:38 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c3bc471c-84b6-11ef-a0bb-8be0dac302b0; Mon, 07 Oct 2024 16:16:37 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.162.58.49]) by support.bugseng.com (Postfix) with ESMTPSA id 4C67E4EE074C; Mon, 7 Oct 2024 16:16:36 +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: c3bc471c-84b6-11ef-a0bb-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1728310597; bh=Cj7N+K8vyoIngmTvtRYCAMfqpWWddHIl9pmTFZ7wneY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlM9scJN3uJ3HDUAg+2dJHb1oLxWkXIjhV32iHKtNcMKHzFdTtGNxjUfVtugP5QZf pinxogS46o5Y5Vq9wmzsTzfT5LtLERkht6uXnM+jIQGHCJbAQ45yG1ckvoTa5PBIH8 hCLAgvPD74v/aZa42Ji+wDxzrJXWnrZstmeFw1bJMszg1MWt2GxMaEaibWDnRBaMwj LugF/OPtHc8rdwS/+F2oAsmwO/Wq935GBF+GPJyj7Ku3Ihp+rgZ481hUrV1EfT1cAh walqsVhR3YBwGY7C0LUc6C4CrKeQOizm7nVh8LJa7sfcezrrbU5S4tz8y4bOTrdrrC XUHLbd6hHFOxA== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v2 4/4] xen/pci: address a violation of MISRA C Rule 16.3 Date: Mon, 7 Oct 2024 16:16:19 +0200 Message-ID: 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: 1728311214536116600 Content-Type: text/plain; charset="utf-8" Refactor the code to avoid an implicit fallthrough and address a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Roger Pau Monn=C3=A9 Reviewed-by: Stefano Stabellini --- Changes in v2: - improved description. --- xen/drivers/passthrough/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 5a446d3dce..a5705def3f 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -170,8 +170,10 @@ static int __init cf_check parse_phantom_dev(const cha= r *str) { case 1: case 2: case 4: if ( *s ) - default: return -EINVAL; + break; + default: + return -EINVAL; } =20 phantom_devs[nr_phantom_devs++] =3D phantom; --=20 2.43.0