qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH qemu.git 1/2] hw/timer/imx_epit: don't shadow variable
  2023-04-05 14:48 [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues ~axelheider
@ 2023-04-04 16:39 ` ~axelheider
  2023-04-04 16:46 ` [PATCH qemu.git 2/2] hw/timer/imx_epit: fix limit check ~axelheider
  2023-04-11 13:32 ` [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: ~axelheider @ 2023-04-04 16:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, qemu-arm

From: Axel Heider <axel.heider@hensoldt.net>

Fix issue reported by Coverity.

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
---
 hw/timer/imx_epit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index 3a869782bc..0821c62cd1 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -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;
-- 
2.38.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH qemu.git 2/2] hw/timer/imx_epit: fix limit check
  2023-04-05 14:48 [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues ~axelheider
  2023-04-04 16:39 ` [PATCH qemu.git 1/2] hw/timer/imx_epit: don't shadow variable ~axelheider
@ 2023-04-04 16:46 ` ~axelheider
  2023-04-11 13:32 ` [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: ~axelheider @ 2023-04-04 16:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, qemu-arm

From: Axel Heider <axel.heider@hensoldt.net>

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

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
---
 hw/timer/imx_epit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index 0821c62cd1..640e4399c2 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -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;
-- 
2.38.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues
@ 2023-04-05 14:48 ~axelheider
  2023-04-04 16:39 ` [PATCH qemu.git 1/2] hw/timer/imx_epit: don't shadow variable ~axelheider
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ~axelheider @ 2023-04-05 14:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, qemu-arm

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(-)

-- 
2.38.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues
  2023-04-05 14:48 [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues ~axelheider
  2023-04-04 16:39 ` [PATCH qemu.git 1/2] hw/timer/imx_epit: don't shadow variable ~axelheider
  2023-04-04 16:46 ` [PATCH qemu.git 2/2] hw/timer/imx_epit: fix limit check ~axelheider
@ 2023-04-11 13:32 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-04-11 13:32 UTC (permalink / raw)
  To: ~axelheider; +Cc: qemu-devel, qemu-arm

On Wed, 5 Apr 2023 at 15:48, ~axelheider <axelheider@git.sr.ht> wrote:
>
> 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(-)



Applied to target-arm.next for 8.1, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-11 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05 14:48 [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues ~axelheider
2023-04-04 16:39 ` [PATCH qemu.git 1/2] hw/timer/imx_epit: don't shadow variable ~axelheider
2023-04-04 16:46 ` [PATCH qemu.git 2/2] hw/timer/imx_epit: fix limit check ~axelheider
2023-04-11 13:32 ` [PATCH qemu.git 0/2] hw/timer/imx_epit: fix reported issues Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).