target/arm: Remove timer_del()/timer_deinit() before timer_free()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Dec 2020 15:41:07 +0000 (15:41 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 8 Jan 2021 15:13:38 +0000 (15:13 +0000)
The Arm CPU finalize function uses a sequence of timer_del(), timer_deinit(),
timer_free() to free the timer. The timer_deinit() step in this was always
unnecessary, and now the timer_del() is implied by timer_free(), so we can
collapse this down to simply calling timer_free().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20201215154107.3255-5-peter.maydell@linaro.org

target/arm/cpu.c

index 62e319eb6ad4677b70581db7200dd5f34f5b299d..8387e94b94460bd57ab55f371f5c546feff0b457 100644 (file)
@@ -1305,8 +1305,6 @@ static void arm_cpu_finalizefn(Object *obj)
     }
 #ifndef CONFIG_USER_ONLY
     if (cpu->pmu_timer) {
-        timer_del(cpu->pmu_timer);
-        timer_deinit(cpu->pmu_timer);
         timer_free(cpu->pmu_timer);
     }
 #endif