From: "Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
qemu-arm@nongnu.org,
"Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
Subject: [PATCH] hw/arm/virt: Use g_assert_not_reached() in virt_get_caches()
Date: Mon, 30 Nov 2026 06:57:20 +0000 [thread overview]
Message-ID: <20261130-virt-assert-not-reached-v1-1-af81f07853a2@gmail.com> (raw)
Replace error_setg(&error_abort, ...) on an unreachable branch with
g_assert_not_reached(), as documented in include/qapi/error.h.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/arm/virt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 0b11f7e..278882e 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -383,8 +383,7 @@ unsigned int virt_get_caches(const VirtMachineState *vms, CPUCoreCaches *caches)
set_cpu_cache(&caches[num_cache++], INSTRUCTION_CACHE, cache_level,
true);
} else {
- error_setg(&error_abort, "Unrecognized cache type");
- return 0;
+ g_assert_not_reached();
}
}
---
base-commit: 9751c62358073580cbf330a4df22077a7c6a407c
change-id: 20261130-virt-assert-not-reached-84c6a3157ac5
Best regards,
--
Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
next reply other threads:[~2026-11-30 6:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 6:57 Oscar Alejandro Sánchez Lucero [this message]
2026-12-01 14:53 ` [PATCH] hw/arm/virt: Use g_assert_not_reached() in virt_get_caches() Bin Meng
2026-12-02 1:31 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130-virt-assert-not-reached-v1-1-af81f07853a2@gmail.com \
--to=aleszlucero@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.