OSDN Git Service

ps2: don't deassert irq twice if queue is empty
authorVolker Rümelin <vr_qemu@t-online.de>
Tue, 25 May 2021 18:14:32 +0000 (20:14 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 26 May 2021 09:28:14 +0000 (11:28 +0200)
Don't deassert the irq twice if the queue is empty. While the
second deassertion doesn't do any harm, it's unnecessary.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-3-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/input/ps2.c

index 7c7a158..5cf95b4 100644 (file)
@@ -520,7 +520,9 @@ uint32_t ps2_read_data(PS2State *s)
         /* reading deasserts IRQ */
         s->update_irq(s->update_arg, 0);
         /* reassert IRQs if data left */
-        s->update_irq(s->update_arg, q->count != 0);
+        if (q->count) {
+            s->update_irq(s->update_arg, 1);
+        }
     }
     return val;
 }