[systemd-devel] [PATCH v2 5/6] udev: builtin-keyboard: add support for EV_ABS_OVERRIDE

Peter Hutterer peter.hutterer at who-t.net
Sun Mar 22 23:40:20 PDT 2015


On Mon, Mar 23, 2015 at 09:15:02AM +0300, Reverend Homer wrote:
[...]
> >+static void override_abs(int fd, const char *devnode,
> >+                         unsigned evcode, const char *value) {
> >+        struct input_absinfo absinfo;
> >+        int rc;
> >+        char *next;
> >+
> >+        rc = ioctl(fd, EVIOCGABS(evcode), &absinfo);
> >+        if (rc < 0) {
> >+                log_error_errno(errno, "Error, unable to EVIOCGABS device '%s'",
> >+                                devnode);
> >+                return;
> >+        }
> >+
> >+        next = parse_token(value, &absinfo.minimum);
> >+        next = parse_token(next, &absinfo.maximum);
> >+        next = parse_token(next, &absinfo.resolution);
> >+        next = parse_token(next, &absinfo.fuzz);
> >+        next = parse_token(next, &absinfo.flat);
> >+        if (!next) {
> >+                log_error("Error, unable to parse EV_ABS override '%s' for '%s'\n",
> >+                          value, devnode);
> >+                return;
> >+        }
> >+
> >+        log_debug("keyboard: override %x with %d/%d/%d/%d/%d", evcode,
> >+                  absinfo.minimum, absinfo.maximum, absinfo.resolution,
> >+                  absinfo.fuzz, absinfo.flat);
> >+        rc = ioctl(fd, EVIOCSABS(evcode), &absinfo);
> >+        if (rc < 0)
> >+                log_error_errno(errno, "Error, unable to update device '%s'",
> >+                                devnode);
> >+
> >+        return;
> Hmmm, do we actually need this "return"?

whoops, leftover from a earlier version, removed locally. thanks.

Cheers,
   Peter



More information about the systemd-devel mailing list