From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTwJ-0000kR-Vv for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjTwG-00049J-0V for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTwF-00048v-Ad for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:35 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6KANYJl026123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jul 2011 06:23:34 -0400 From: Gerd Hoffmann Date: Wed, 20 Jul 2011 12:23:23 +0200 Message-Id: <1311157404-12362-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1311157404-12362-1-git-send-email-kraxel@redhat.com> References: <1311157404-12362-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] usb-hid: fixup changed tracking. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Remove leftover calls to usb_hid_changed(). Take care to update the changed flag after delivering a event via GET_REPORT like we do when sending events via interrupt endpoint. Signed-off-by: Gerd Hoffmann --- hw/usb-hid.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/usb-hid.c b/hw/usb-hid.c index d711b5c..b812da2 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -531,18 +531,15 @@ static void usb_keyboard_process_keycode(USBHIDState *hs) case 0xe0: if (s->modifiers & (1 << 9)) { s->modifiers ^= 3 << 8; - usb_hid_changed(hs); return; } case 0xe1 ... 0xe7: if (keycode & (1 << 7)) { s->modifiers &= ~(1 << (hid_code & 0x0f)); - usb_hid_changed(hs); return; } case 0xe8 ... 0xef: s->modifiers |= 1 << (hid_code & 0x0f); - usb_hid_changed(hs); return; } @@ -769,10 +766,12 @@ static int usb_hid_handle_control(USBDevice *dev, USBPacket *p, } break; case GET_REPORT: - if (s->kind == USB_MOUSE || s->kind == USB_TABLET) + if (s->kind == USB_MOUSE || s->kind == USB_TABLET) { ret = usb_pointer_poll(s, data, length); - else if (s->kind == USB_KEYBOARD) + } else if (s->kind == USB_KEYBOARD) { ret = usb_keyboard_poll(s, data, length); + } + s->changed = s->n > 0; break; case SET_REPORT: if (s->kind == USB_KEYBOARD) -- 1.7.1