hw/timer/imx_epit: fix reported issues
cover hw/timer/imx_epit: fix reported issues
This patchset fixes the following issues:
- variable shadowing reported by Coverity
- fix check, see https://gitlab.com/qemu-project/qemu/-/issues/1491
Axel Heider (2):
hw/timer/imx_epit: don't shadow variable
hw/timer/imx_epit: fix limit check
hw/timer/imx_epit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.38.4
PATCH 1/2 hw/timer/imx_epit: don't shadow variable
From: Axel Heider <[email protected]>
Fix issue reported by Coverity.
--- hw/timer/imx_epit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/timer/imx_epit.c +1 -1
@@ -179,7 +179,7 @@ static void imx_epit_update_compare_timer(IMXEPITState *s)* the compare value. Otherwise it may fire at most once in the * current round. */ -bool is_oneshot = (limit >= s->cmp); + is_oneshot = (limit >= s->cmp);if (counter >= s->cmp) {/* The compare timer fires in the current round. */ counter -= s->cmp;
Signature · 1 line
2.38.4
PATCH 2/2 hw/timer/imx_epit: fix limit check
In reply to ~axelheiderFrom: Axel Heider <[email protected]>
Fix the limit check. If the limit is less than the compare value, the timer can never reach this value, thus it will never fire.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1491
--- hw/timer/imx_epit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/timer/imx_epit.c +1 -1
@@ -179,7 +179,7 @@ static void imx_epit_update_compare_timer(IMXEPITState *s)* the compare value. Otherwise it may fire at most once in the * current round. */ - is_oneshot = (limit >= s->cmp); + is_oneshot = (limit < s->cmp);if (counter >= s->cmp) {/* The compare timer fires in the current round. */ counter -= s->cmp;
Signature · 1 line
2.38.4
Peter Maydell
AppliedQuoted 11 lines · ~axelheider
This patchset fixes the following issues:
- variable shadowing reported by Coverity
- fix check, see https://gitlab.com/qemu-project/qemu/-/issues/1491Axel Heider (2):
hw/timer/imx_epit: don't shadow variable
hw/timer/imx_epit: fix limit checkhw/timer/imx_epit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to target-arm.next for 8.1, thanks.
-- PMM