File U_01-Remove-unused-code.patch of Package xf86-input-wacom
From: Egbert Eich <eich@suse.com>
Date: Wed Apr 9 21:27:00 2014 +0200
Subject: [PATCH 1/6]Remove unused code
Patch-Mainline: Upstream
Git-commit: 840e6585ab273828d6bcf1f0d0f4293f4ddb631a
Git-repo: git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <eich@suse.com>
usbFindDeviceType() is only called once. From where it
is called, it is only called if event->value != 0 and
with ds->device_id = event->value.
Thus the test !ds->device_id will always fail.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
---
src/wcmUSB.c | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 7375711..3e5c31d 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1100,33 +1100,20 @@ static int usbIdToType(int id)
}
/**
- * Find the tool type (STYLUS_ID, etc.) based on the device_id or the
- * current tool serial number if the device_id is unknown (0).
+ * Find the tool type (STYLUS_ID, etc.) based on the device_id.
*
* Protocol 5 devices report different IDs for different styli and pucks,
* Protocol 4 devices simply report STYLUS_DEVICE_ID, etc.
*
* @param ds The current device state received from the kernel.
- * @return The tool type associated with the tool id or the current
- * tool serial number.
+ * @return The tool type associated with the tool id.
*/
static int usbFindDeviceType(const WacomCommonPtr common,
const WacomDeviceState *ds)
{
- WacomToolPtr tool = NULL;
int device_type = 0;
- if (!ds->device_id && ds->serial_num)
- {
- for (tool = common->wcmTool; tool; tool = tool->next)
- if (ds->serial_num == tool->serial)
- {
- device_type = tool->typeid;
- break;
- }
- }
-
- if (device_type || !ds->device_id) return device_type;
+ if (!ds->device_id) return 0;
switch (ds->device_id)
{