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