From 8ae5ad2ccdc60318a21cc309610e31d4066dc890 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 26 Aug 2016 07:10:01 +0200 Subject: [PATCH] PS/2: fix dead code. hrev50506 extended the range of acceptable X and Y movement for PS/2 mouse. However, the value is sent on 1 byte (+ sign) so the check would now always be valid. Remove the check completely, we now rely only on bit 3 of the first byte to be set (and not missing packets) to remain in sync with the mouse. Thanks to Marcus Overhagen for reviewing the changes. --- .../kernel/bus_managers/ps2/ps2_standard_mouse.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_standard_mouse.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_standard_mouse.cpp index 5dbe34562f..4c7104d3d5 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_standard_mouse.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_standard_mouse.cpp @@ -230,22 +230,10 @@ standard_mouse_handle_int(ps2_dev* dev) if (cookie->packet_index == 1) { int xDelta = ((cookie->buffer[0] & 0x10) ? 0xFFFFFF00 : 0) | data; - if (xDelta < -256 || xDelta > 255) { - INFO("ps2: strange mouse data, x-delta %d, trying resync\n", - xDelta); - cookie->packet_index = 0; - return B_HANDLED_INTERRUPT; - } } if (cookie->packet_index == 2) { int yDelta = ((cookie->buffer[0] & 0x20) ? 0xFFFFFF00 : 0) | data; - if (yDelta < -256 || yDelta > 255) { - INFO("ps2: strange mouse data, y-delta %d, trying resync\n", - yDelta); - cookie->packet_index = 0; - return B_HANDLED_INTERRUPT; - } } cookie->buffer[cookie->packet_index++] = data;