(resend)[PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable
diff mbox series

Message ID 20180507123014.C67BE3818FB@moya.office.hostfission.com
State New
Headers show
Series
  • (resend)[PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable
Related show

Commit Message

Keith Packard" via May 7, 2018, 11:42 a.m. UTC
This allows guest's to correctly reinitialize and identify the mouse
should the guest decide to re-scan or reset during mouse input events.

Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
 hw/input/ps2.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

no-reply@patchew.org May 7, 2018, 12:34 p.m. UTC | #1
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180507123014.C67BE3818FB@moya.office.hostfission.com
Subject: [Qemu-devel] (resend)[PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20180507123014.C67BE3818FB@moya.office.hostfission.com -> patchew/20180507123014.C67BE3818FB@moya.office.hostfission.com
Switched to a new branch 'test'
4da12af985 (resend)[PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable

=== OUTPUT BEGIN ===
Checking PATCH 1/1: (resend)[PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable...
ERROR: braces {} are necessary for all arms of this statement
#21: FILE: hw/input/ps2.c:676:
+    if (!(s->mouse_status & MOUSE_STATUS_ENABLED))
[...]

total: 1 errors, 0 warnings, 16 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

Patch
diff mbox series

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 06f5d2ac4a..6edf046820 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -673,6 +673,9 @@  static void ps2_mouse_sync(DeviceState *dev)
 {
     PS2MouseState *s = (PS2MouseState *)dev;
 
+    if (!(s->mouse_status & MOUSE_STATUS_ENABLED))
+        return;
+
     if (s->mouse_buttons) {
         qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER);
     }
@@ -776,6 +779,7 @@  void ps2_write_mouse(void *opaque, int val)
             s->mouse_resolution = 2;
             s->mouse_status = 0;
             s->mouse_type = 0;
+            ps2_reset_queue(&s->common);
             ps2_queue(&s->common, AUX_ACK);
             ps2_queue(&s->common, 0xaa);
             ps2_queue(&s->common, s->mouse_type);