[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] hw/timer/slavio_timer: Remove useless check for NULL
|
From: |
Richard Henderson |
|
Subject: |
Re: [PATCH v2 1/3] hw/timer/slavio_timer: Remove useless check for NULL t->timer |
|
Date: |
Mon, 21 Oct 2019 09:24:11 -0700 |
|
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 10/21/19 6:43 AM, Peter Maydell wrote:
> In the slavio timer devcie, 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 <address@hidden>
> ---
> hw/timer/slavio_timer.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~
- [PATCH v2 0/3] Convert sparc devices to new ptimer API, Peter Maydell, 2019/10/21
- [PATCH v2 1/3] hw/timer/slavio_timer: Remove useless check for NULL t->timer, Peter Maydell, 2019/10/21
- [PATCH v2 2/3] hw/timer/grlib_gptimer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/21
- [PATCH v2 3/3] hw/timer/slavio_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/21
- Re: [PATCH v2 0/3] Convert sparc devices to new ptimer API, Philippe Mathieu-Daudé, 2019/10/21
- Re: [PATCH v2 0/3] Convert sparc devices to new ptimer API, Peter Maydell, 2019/10/24