From: Volker Rümelin Date: Tue, 25 May 2021 18:14:32 +0000 (+0200) Subject: ps2: don't deassert irq twice if queue is empty X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cec3252416bb76d3c5cee178825a6321950cedec;p=qmiga%2Fqemu.git ps2: don't deassert irq twice if queue is empty 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é Signed-off-by: Volker Rümelin Message-Id: <20210525181441.27768-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 7c7a158e31..5cf95b4dd3 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -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; }