]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/mips/malta: Fix minor dead code issue
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 12 May 2023 14:43:38 +0000 (15:43 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 12 May 2023 14:43:38 +0000 (15:43 +0100)
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>
hw/mips/malta.c

index af9021316de79674b67d38d5d5f71284cec54cfa..e3be2eea563d6648bcd224eaf2e79c231ff4c813 100644 (file)
@@ -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);