From patchwork Mon Dec 5 07:26:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiamei Xie X-Patchwork-Id: 13064220 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 10815C4321E for ; Mon, 5 Dec 2022 07:28:00 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.453200.710881 (Exim 4.92) (envelope-from ) id 1p25tH-0003Dk-Pp; Mon, 05 Dec 2022 07:27:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 453200.710881; Mon, 05 Dec 2022 07:27:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p25tH-0003DY-Mr; Mon, 05 Dec 2022 07:27:51 +0000 Received: by outflank-mailman (input) for mailman id 453200; Mon, 05 Dec 2022 07:27:51 +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 1p25tH-0002UH-1M for xen-devel@lists.xenproject.org; Mon, 05 Dec 2022 07:27:51 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id 52ab5f3b-746e-11ed-91b6-6bf2151ebd3b; Mon, 05 Dec 2022 08:27:50 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6665B23A; Sun, 4 Dec 2022 23:27:56 -0800 (PST) Received: from a015971.shanghai.arm.com (unknown [10.169.188.104]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5659C3F73D; Sun, 4 Dec 2022 23:27:47 -0800 (PST) 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: 52ab5f3b-746e-11ed-91b6-6bf2151ebd3b From: Jiamei Xie To: xen-devel@lists.xenproject.org Cc: wei.chen@arm.com, jiamei.xie@arm.com, Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v5 2/2] xen/arm: vpl011: add ASSERT_UNREACHABLE in vpl011_mmio_read Date: Mon, 5 Dec 2022 15:26:40 +0800 Message-Id: <20221205072640.2092473-3-jiamei.xie@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221205072640.2092473-1-jiamei.xie@arm.com> References: <20221205072640.2092473-1-jiamei.xie@arm.com> MIME-Version: 1.0 In vpl011_mmio_read switch block, all cases should have a return. Add ASSERT_UNREACHABLE to catch case where the return is not added. Signed-off-by: Jiamei Xie Acked-by: Julien Grall --- v4 -> v5 - don't remove "return 1" and add ASSERT_UNREACHABLE v3 -> v4 - Don't consolidate check registers access - Don't remove label read_as_zero --- xen/arch/arm/vpl011.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c index f4a5621fab..c7f9dae76c 100644 --- a/xen/arch/arm/vpl011.c +++ b/xen/arch/arm/vpl011.c @@ -417,6 +417,7 @@ static int vpl011_mmio_read(struct vcpu *v, goto read_as_zero; } + ASSERT_UNREACHABLE(); return 1; read_as_zero: