diff mbox series

[v5,2/2] xen/arm: vpl011: add ASSERT_UNREACHABLE in vpl011_mmio_read

Message ID 20221205072640.2092473-3-jiamei.xie@arm.com (mailing list archive)
State New, archived
Headers show
Series xen/arm: refine vpl011 | expand

Commit Message

Jiamei Xie Dec. 5, 2022, 7:26 a.m. UTC
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 <jiamei.xie@arm.com>
---
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(+)

Comments

Julien Grall Dec. 6, 2022, 6:22 p.m. UTC | #1
Hi,

On 05/12/2022 07:26, Jiamei Xie wrote:
> 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 <jiamei.xie@arm.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,
diff mbox series

Patch

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: