qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH qemu.git v3 8/8] hw/timer/imx_epit: fix compare timer handlin


From: Axel Heider
Subject: Re: [PATCH qemu.git v3 8/8] hw/timer/imx_epit: fix compare timer handling
Date: Tue, 4 Apr 2023 18:26:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

Peter,

Hi; Coverity has just noticed an issue with this patch:
[...]
Here we declare the is_oneshot variable...
[...]
...but here we declare another is_oneshot, which shadows the first
declaration...
...so here when the inner variable is no longer in scope, the
value of the outer is_oneshot variable must always be 'false',
because there's never any assignment to it.
What was the intention here? My guess is that there should only
have been one 'is_oneshot', not two.

The shadowing is not intended, as this does not make any sense. There
is only one instance of this variable, it is FALSE by default and can
become TRUE.

[...]
There's also been this bug report:
https://gitlab.com/qemu-project/qemu/-/issues/1491
which suggests that the condition for setting is_oneshot
should be "(limit <= s->cmp)" rather than ">=".
What do you think ?

The Bug report is right, that the check should be
"(limit <= s->cmp)", as it's about the on-shot characteristic and not
the periodic characteristic (which earler version of the patch had).


I will provide a patch to fix this.


Axel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]