From: Philippe Mathieu-Daudé Date: Tue, 21 Jan 2025 11:12:21 +0000 (+0100) Subject: hw/core/generic-loader: Do not open-code cpu_set_pc() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2beb871dc20b57fc4b1ec2285dfc2145baf9df80;p=qemu.git hw/core/generic-loader: Do not open-code cpu_set_pc() Directly call cpu_set_pc() instead of open-coding it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250122093028.52416-2-philmd@linaro.org> --- diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index d9f5c2e832..d3a426a1a2 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -47,11 +47,8 @@ static void generic_loader_reset(void *opaque) GenericLoaderState *s = GENERIC_LOADER(opaque); if (s->set_pc) { - CPUClass *cc = CPU_GET_CLASS(s->cpu); cpu_reset(s->cpu); - if (cc) { - cc->set_pc(s->cpu, s->addr); - } + cpu_set_pc(s->cpu, s->addr); } if (s->data_len) {