mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
hw/timer/slavio_timer: Remove useless check for NULL t->timer
In the slavio timer device, the ptimer TimerContext::timer is always created by slavio_timer_init(), so there's no need to check it for NULL; remove the single unneeded NULL check. This will be useful to avoid compiler/Coverity errors when a subsequent change adds a use of t->timer before the location we currently do the NULL check. 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: 20191021134357.14266-2-peter.maydell@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
e982ba0524
commit
5e3478925d
1 changed files with 5 additions and 7 deletions
|
@ -227,13 +227,11 @@ static void slavio_timer_mem_writel(void *opaque, hwaddr addr,
|
||||||
// set limit, reset counter
|
// set limit, reset counter
|
||||||
qemu_irq_lower(t->irq);
|
qemu_irq_lower(t->irq);
|
||||||
t->limit = val & TIMER_MAX_COUNT32;
|
t->limit = val & TIMER_MAX_COUNT32;
|
||||||
if (t->timer) {
|
if (t->limit == 0) { /* free-run */
|
||||||
if (t->limit == 0) { /* free-run */
|
ptimer_set_limit(t->timer,
|
||||||
ptimer_set_limit(t->timer,
|
LIMIT_TO_PERIODS(TIMER_MAX_COUNT32), 1);
|
||||||
LIMIT_TO_PERIODS(TIMER_MAX_COUNT32), 1);
|
} else {
|
||||||
} else {
|
ptimer_set_limit(t->timer, LIMIT_TO_PERIODS(t->limit), 1);
|
||||||
ptimer_set_limit(t->timer, LIMIT_TO_PERIODS(t->limit), 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue