diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2023-05-12 15:43:38 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-05-12 15:43:38 +0100 |
commit | 9d8299bf93eb7c2ea5fd64716352b9454fa7fe8c (patch) | |
tree | f210e1dbb0bd230400f89b0fedba0566425b8f0d /hw | |
parent | d6359e150dbdf84f67add786473fd277a9a442bb (diff) | |
download | qemu-9d8299bf93eb7c2ea5fd64716352b9454fa7fe8c.zip qemu-9d8299bf93eb7c2ea5fd64716352b9454fa7fe8c.tar.gz qemu-9d8299bf93eb7c2ea5fd64716352b9454fa7fe8c.tar.bz2 |
hw/mips/malta: Fix minor dead code issue
Coverity points out (in CID 1508390) that write_bootloader has
some dead code, where we assign to 'p' and then in the following
line assign to it again. This happened as a result of the
refactoring in commit cd5066f8618b.
Fix the dead code by removing the 'void *v' variable entirely and
instead adding a cast when calling bl_setup_gt64120_jump_kernel(), as
we do at its other callsite in write_bootloader_nanomips().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/mips/malta.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/mips/malta.c b/hw/mips/malta.c index af90213..e3be2ee 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -748,7 +748,6 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr, uint64_t kernel_entry) { uint32_t *p; - void *v; /* Small bootloader */ p = (uint32_t *)base; @@ -785,9 +784,7 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr, * */ - v = p; - bl_setup_gt64120_jump_kernel(&v, run_addr, kernel_entry); - p = v; + bl_setup_gt64120_jump_kernel((void **)&p, run_addr, kernel_entry); /* YAMON subroutines */ p = (uint32_t *) (base + 0x800); |