test: don't check for a max on EV_SYN events
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 27 Jun 2013 01:02:39 +0000 (11:02 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 27 Jun 2013 01:02:39 +0000 (11:02 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/test-common-uinput.c

index db19ac0d9982658362eb74079d5b0e67f6fca0a1..691818b0cc47033b197769f637bf4e7d98b7e32b 100644 (file)
@@ -368,9 +368,11 @@ uinput_device_event(const struct uinput_device *dev, unsigned int type, unsigned
        if (type > EV_MAX)
                return -EINVAL;
 
-       max = type_to_mask_const(&dev->d, type, &mask);
-       if (max == -1 || code > max)
-               return -EINVAL;
+       if (type != EV_SYN) {
+               max = type_to_mask_const(&dev->d, type, &mask);
+               if (max == -1 || code > max)
+                       return -EINVAL;
+       }
 
        ev.type = type;
        ev.code = code;