[PATCH evdev 2/3] Drop cached name and led_bitmask - nothing reads this

Peter Hutterer peter.hutterer at who-t.net
Wed May 29 21:14:08 PDT 2013


Both fields are write-only as of xf86-input-evdev-2.5.99.902-1-g1ced7ec

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 18 ------------------
 src/evdev.h |  2 --
 2 files changed, 20 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 86af151..34cd3a1 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1983,12 +1983,10 @@ EvdevCache(InputInfoPtr pInfo)
     int i, len;
     struct input_id id;
 
-    char name[1024]                  = {0};
     unsigned long bitmask[NLONGS(EV_CNT)]      = {0};
     unsigned long key_bitmask[NLONGS(KEY_CNT)] = {0};
     unsigned long rel_bitmask[NLONGS(REL_CNT)] = {0};
     unsigned long abs_bitmask[NLONGS(ABS_CNT)] = {0};
-    unsigned long led_bitmask[NLONGS(LED_CNT)] = {0};
 
 
     if (ioctl(pInfo->fd, EVIOCGID, &id) < 0)
@@ -2000,13 +1998,6 @@ EvdevCache(InputInfoPtr pInfo)
     pEvdev->id_vendor = id.vendor;
     pEvdev->id_product = id.product;
 
-    if (ioctl(pInfo->fd, EVIOCGNAME(sizeof(name) - 1), name) < 0) {
-        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGNAME failed: %s\n", strerror(errno));
-        goto error;
-    }
-
-    strcpy(pEvdev->name, name);
-
     len = ioctl(pInfo->fd, EVIOCGBIT(0, sizeof(bitmask)), bitmask);
     if (len < 0) {
         xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT for bitmask failed: %s\n",
@@ -2034,15 +2025,6 @@ EvdevCache(InputInfoPtr pInfo)
 
     memcpy(pEvdev->abs_bitmask, abs_bitmask, len);
 
-    len = ioctl(pInfo->fd, EVIOCGBIT(EV_LED, sizeof(led_bitmask)), led_bitmask);
-    if (len < 0) {
-        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT for EV_LED failed: %s\n",
-                    strerror(errno));
-        goto error;
-    }
-
-    memcpy(pEvdev->led_bitmask, led_bitmask, len);
-
     /*
      * Do not try to validate absinfo data since it is not expected
      * to be static, always refresh it in evdev structure.
diff --git a/src/evdev.h b/src/evdev.h
index 6ae389c..4742b43 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -235,12 +235,10 @@ typedef struct {
     OsTimerPtr reopen_timer;
 
     /* Cached info from device. */
-    char name[1024];
     unsigned long bitmask[NLONGS(EV_CNT)];
     unsigned long key_bitmask[NLONGS(KEY_CNT)];
     unsigned long rel_bitmask[NLONGS(REL_CNT)];
     unsigned long abs_bitmask[NLONGS(ABS_CNT)];
-    unsigned long led_bitmask[NLONGS(LED_CNT)];
     struct input_absinfo absinfo[ABS_CNT];
 
     /* minor/major number */
-- 
1.8.1.4



More information about the xorg-devel mailing list