[PATCH v1] hw/input/ps2: Use ps2_raise_irq() instead of open coding it

Ani Sinha posted 1 patch 2 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/next-importer-push tags/patchew/20210531055125.148282-1-anirban.sinha@nokia.com
hw/input/ps2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH v1] hw/input/ps2: Use ps2_raise_irq() instead of open coding it
Posted by Ani Sinha 2 years, 11 months ago
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Inspired-by: Volker Rümelin <vr_qemu@t-online.de>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210513171244.3940519-1-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/input/ps2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 5cf95b4dd3..8dd482c1f6 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -217,7 +217,7 @@ void ps2_queue(PS2State *s, int b)
     }
 
     ps2_queue_noirq(s, b);
-    s->update_irq(s->update_arg, 1);
+    ps2_raise_irq(s);
 }
 
 void ps2_queue_2(PS2State *s, int b1, int b2)
@@ -228,7 +228,7 @@ void ps2_queue_2(PS2State *s, int b1, int b2)
 
     ps2_queue_noirq(s, b1);
     ps2_queue_noirq(s, b2);
-    s->update_irq(s->update_arg, 1);
+    ps2_raise_irq(s);
 }
 
 void ps2_queue_3(PS2State *s, int b1, int b2, int b3)
@@ -240,7 +240,7 @@ void ps2_queue_3(PS2State *s, int b1, int b2, int b3)
     ps2_queue_noirq(s, b1);
     ps2_queue_noirq(s, b2);
     ps2_queue_noirq(s, b3);
-    s->update_irq(s->update_arg, 1);
+    ps2_raise_irq(s);
 }
 
 void ps2_queue_4(PS2State *s, int b1, int b2, int b3, int b4)
@@ -253,7 +253,7 @@ void ps2_queue_4(PS2State *s, int b1, int b2, int b3, int b4)
     ps2_queue_noirq(s, b2);
     ps2_queue_noirq(s, b3);
     ps2_queue_noirq(s, b4);
-    s->update_irq(s->update_arg, 1);
+    ps2_raise_irq(s);
 }
 
 /* keycode is the untranslated scancode in the current scancode set. */
-- 
2.25.1


Re: [PATCH v1] hw/input/ps2: Use ps2_raise_irq() instead of open coding it
Posted by Ani Sinha 2 years, 11 months ago
My apologies … please ignore …

On Mon, May 31, 2021 at 11:21 Ani Sinha <ani@anisinha.ca> wrote:

> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> Inspired-by: Volker Rümelin <vr_qemu@t-online.de>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Message-Id: <20210513171244.3940519-1-f4bug@amsat.org>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/input/ps2.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index 5cf95b4dd3..8dd482c1f6 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -217,7 +217,7 @@ void ps2_queue(PS2State *s, int b)
>      }
>
>      ps2_queue_noirq(s, b);
> -    s->update_irq(s->update_arg, 1);
> +    ps2_raise_irq(s);
>  }
>
>  void ps2_queue_2(PS2State *s, int b1, int b2)
> @@ -228,7 +228,7 @@ void ps2_queue_2(PS2State *s, int b1, int b2)
>
>      ps2_queue_noirq(s, b1);
>      ps2_queue_noirq(s, b2);
> -    s->update_irq(s->update_arg, 1);
> +    ps2_raise_irq(s);
>  }
>
>  void ps2_queue_3(PS2State *s, int b1, int b2, int b3)
> @@ -240,7 +240,7 @@ void ps2_queue_3(PS2State *s, int b1, int b2, int b3)
>      ps2_queue_noirq(s, b1);
>      ps2_queue_noirq(s, b2);
>      ps2_queue_noirq(s, b3);
> -    s->update_irq(s->update_arg, 1);
> +    ps2_raise_irq(s);
>  }
>
>  void ps2_queue_4(PS2State *s, int b1, int b2, int b3, int b4)
> @@ -253,7 +253,7 @@ void ps2_queue_4(PS2State *s, int b1, int b2, int b3,
> int b4)
>      ps2_queue_noirq(s, b2);
>      ps2_queue_noirq(s, b3);
>      ps2_queue_noirq(s, b4);
> -    s->update_irq(s->update_arg, 1);
> +    ps2_raise_irq(s);
>  }
>
>  /* keycode is the untranslated scancode in the current scancode set. */
> --
> 2.25.1
>
>