[PATCH libevdev 3/7] Allow enabling of EV_SYN codes

Peter Hutterer peter.hutterer at who-t.net
Sun Jul 28 21:06:33 PDT 2013


Has no effect, but allow it nonetheless to avoid superfluous
conditions in client code.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 libevdev/libevdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
index 3a6c6eb..c517704 100644
--- a/libevdev/libevdev.c
+++ b/libevdev/libevdev.c
@@ -855,6 +855,9 @@ libevdev_enable_event_code(struct libevdev *dev, unsigned int type,
 	if (type != EV_ABS && data != NULL)
 		return -1;
 
+	if (type == EV_SYN)
+		return 0;
+
 	max = type_to_mask(dev, type, &mask);
 
 	if (code > max)
-- 
1.8.2.1



More information about the Input-tools mailing list