提交 5f2c23e6 编写于 作者: S Stefan Weil 提交者: Alexander Graf

ppce500_spin: Replace assert by hw_error (fixes compiler warning)

The default case in function spin_read should never be reached,
therefore the old code used assert(0) to abort QEMU.

This does not work when QEMU is compiled with macro NDEBUG defined.
In this case (and also when the compiler does not know that assert
never returns), there is a compiler warning because of the missing
return value.

Using hw_error allows an improved error message and aborts always.
Signed-off-by: NStefan Weil <sw@weilnetz.de>
[agraf: use __func__]
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 73f7821b
......@@ -179,7 +179,7 @@ static uint64_t spin_read(void *opaque, target_phys_addr_t addr, unsigned len)
case 4:
return ldl_p(spin_p);
default:
assert(0);
hw_error("ppce500: unexpected %s with len = %u", __func__, len);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册