Blame SOURCES/0068-evdev-do-not-rely-on-EVIOC-constants-provided-in-lin.patch

86f512
From 8cff8e59d501e41af8de9b0ff0e2f7bf65fc22f2 Mon Sep 17 00:00:00 2001
86f512
From: Eugene Syromyatnikov <evgsyr@gmail.com>
86f512
Date: Sun, 13 Oct 2019 17:18:38 +0200
86f512
Subject: [PATCH 68/76] evdev: do not rely on EVIOC* constants provided in
86f512
 <linux/input.h>
86f512
86f512
* xlat/evdev_ioctl_cmds.in: New file.
86f512
* configure.ac (AC_CHECK_HEADERS([linux/input.h])): Check for struct
86f512
input_keymap_entry and struct input_mask.
86f512
* evdev.c [!INPUT_PROP_MAX] (INPUT_PROP_MAX): New macro definition.
86f512
(struct_input_keymap_entry, struct_input_mask): New typedefs.
86f512
[HAVE_STRUCT_INPUT_KEYMAP_ENTRY]: Add a static_assert to check
86f512
that sizeof(struct input_keymap_entry) has the expected value.
86f512
[HAVE_STRUCT_INPUT_MASK]: Add a static_assert to check
86f512
that sizeof(struct input_mask) has the expected value.
86f512
[!EVIOCGPROP] (EVIOCGPROP): New macro definition.
86f512
[!EVIOCGMTSLOTS] (EVIOCGMTSLOTS): Likewise.
86f512
[!EVIOCGSW] (EVIOCGSW): Likewise.
86f512
[!EVIOCGKEYCODE_V2] (keycode_V2_ioctl): Remove guard.
86f512
(keycode_V2_ioctl): Change type of ike to struct_input_keymap_entry.
86f512
[!EVIOCGMTSLOTS] (mtslots_ioctl): Remove guard.
86f512
[!EVIOCGREP || EVIOCSREP] (repeat_ioctl): Likewise.
86f512
(evdev_read_ioctl) [!EVIOCGREP] <case EVIOCGREP>: Likewise.
86f512
(evdev_read_ioctl) [!EVIOCGKEYCODE_V2] <case EVIOCGKEYCODE_V2>:
86f512
Likewise.
86f512
(evdev_read_ioctl) [!EVIOCGMTSLOTS] <case EVIOCGMTSLOTS>: Likewise.
86f512
(evdev_read_ioctl) [!EVIOCGPROP] <case EVIOCGPROP>: Likewise.
86f512
(evdev_read_ioctl) [!EVIOCGSW] <case EVIOCGSW>: Likewise.
86f512
(evdev_write_ioctl) [!EVIOCSREP] <case EVIOCSREP>: Likewise.
86f512
(evdev_write_ioctl) [!EVIOCSKEYCODE_V2] <case EVIOCSKEYCODE_V2>: Likewise.
86f512
(evdev_write_ioctl) [!EVIOCREVOKE] <case EVIOCREVOKE>: Likewise.
86f512
(evdev_write_ioctl) [!EVIOCSCLOCKID] <case EVIOCSCLOCKID>: Likewise.
86f512
86f512
References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201
86f512
86f512
Conflicts:
86f512
	evdev.c
86f512
---
86f512
 configure.ac             |  4 +++
86f512
 evdev.c                  | 75 ++++++++++++++++++++++++++++++++----------------
86f512
 xlat/evdev_ioctl_cmds.in | 17 +++++++++++
86f512
 3 files changed, 71 insertions(+), 25 deletions(-)
86f512
 create mode 100644 xlat/evdev_ioctl_cmds.in
86f512
86f512
Index: strace-5.1/configure.ac
86f512
===================================================================
86f512
--- strace-5.1.orig/configure.ac	2020-01-29 12:35:51.722702560 +0100
86f512
+++ strace-5.1/configure.ac	2020-01-29 12:37:35.136765878 +0100
86f512
@@ -453,6 +453,10 @@
86f512
 #include <net/if.h>])
86f512
 
86f512
 AC_CHECK_HEADERS([linux/input.h], [
86f512
+	AC_CHECK_TYPES(m4_normalize([
86f512
+		struct input_keymap_entry,
86f512
+		struct input_mask
86f512
+	]),,, [#include <linux/input.h>])
86f512
 	AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
86f512
 ])
86f512
 
86f512
Index: strace-5.1/evdev.c
86f512
===================================================================
86f512
--- strace-5.1.orig/evdev.c	2020-01-29 12:35:42.692778989 +0100
86f512
+++ strace-5.1/evdev.c	2020-01-29 12:37:35.139765850 +0100
86f512
@@ -29,10 +29,59 @@
86f512
 # include "xlat/evdev_snd.h"
86f512
 # include "xlat/evdev_switch.h"
86f512
 
86f512
+/** Added by Linux commit v2.6.38-rc1~247^2~1^2~2^2~5 */
86f512
+# ifndef INPUT_PROP_MAX
86f512
+#  define INPUT_PROP_MAX 0x1f
86f512
+# endif
86f512
 # ifndef SYN_MAX
86f512
 #  define SYN_MAX 0xf
86f512
 # endif
86f512
 
86f512
+/** Added by Linux commit v2.6.37-rc1~5^2~3^2~47 */
86f512
+typedef struct {
86f512
+	uint8_t  flags;
86f512
+	uint8_t  len;
86f512
+	uint16_t index;
86f512
+	uint32_t keycode;
86f512
+	uint8_t  scancode[32];
86f512
+} struct_input_keymap_entry;
86f512
+
86f512
+/** Added by Linux commit v4.4-rc1~11^2~3^2~2 */
86f512
+typedef struct {
86f512
+	uint32_t type;
86f512
+	uint32_t codes_size;
86f512
+	uint64_t codes_ptr;
86f512
+} struct_input_mask;
86f512
+
86f512
+# ifdef HAVE_STRUCT_INPUT_KEYMAP_ENTRY
86f512
+static_assert(sizeof(struct input_keymap_entry)
86f512
+	      == sizeof(struct_input_keymap_entry),
86f512
+	      "Unexpected struct input_keymap_entry size, please update "
86f512
+	      "the decoder");
86f512
+# endif
86f512
+# ifdef HAVE_STRUCT_INPUT_MASK
86f512
+static_assert(sizeof(struct input_mask) == sizeof(struct_input_mask),
86f512
+	      "Unexpected struct input_mask size, please update the decoder");
86f512
+# endif
86f512
+
86f512
+/*
86f512
+ * Has to be included after struct_* type definitions, since _IO* macros
86f512
+ * used in fallback definitions require them for sizeof().
86f512
+ */
86f512
+# define XLAT_MACROS_ONLY
86f512
+#  include "xlat/evdev_ioctl_cmds.h"
86f512
+# undef XLAT_MACROS_ONLY
86f512
+
86f512
+# ifndef EVIOCGPROP
86f512
+#  define EVIOCGPROP(len)	_IOR('E', 0x09, len)
86f512
+# endif
86f512
+# ifndef EVIOCGMTSLOTS
86f512
+#  define EVIOCGMTSLOTS(len)	_IOR('E', 0x0a, len)
86f512
+# endif
86f512
+# ifndef EVIOCGSW
86f512
+#  define EVIOCGSW(len)		_IOR('E', 0x1b, len)
86f512
+# endif
86f512
+
86f512
 const size_t evdev_abs_size = ARRAY_SIZE(evdev_abs) - 1;
86f512
 
86f512
 static int
86f512
@@ -85,13 +134,12 @@
86f512
 	return RVAL_IOCTL_DECODED;
86f512
 }
86f512
 
86f512
-# ifdef EVIOCGKEYCODE_V2
86f512
 static int
86f512
 keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
86f512
 {
86f512
 	tprints(", ");
86f512
 
86f512
-	struct input_keymap_entry ike;
86f512
+	struct_input_keymap_entry ike;
86f512
 
86f512
 	if (umove_or_printaddr(tcp, arg, &ike))
86f512
 		return RVAL_IOCTL_DECODED;
86f512
@@ -121,7 +169,6 @@
86f512
 
86f512
 	return RVAL_IOCTL_DECODED;
86f512
 }
86f512
-# endif /* EVIOCGKEYCODE_V2 */
86f512
 
86f512
 static int
86f512
 getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
86f512
@@ -201,7 +248,6 @@
86f512
 	decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \
86f512
 		       (dflt_), ARRAY_SIZE(decode_nr_) - 1, (xt_))
86f512
 
86f512
-# ifdef EVIOCGMTSLOTS
86f512
 static int
86f512
 mtslots_ioctl(struct tcb *const tcp, const unsigned int code,
86f512
 	      const kernel_ulong_t arg)
86f512
@@ -232,9 +278,7 @@
86f512
 
86f512
 	return RVAL_IOCTL_DECODED;
86f512
 }
86f512
-# endif /* EVIOCGMTSLOTS */
86f512
 
86f512
-# if defined EVIOCGREP || defined EVIOCSREP
86f512
 static int
86f512
 repeat_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
86f512
 {
86f512
@@ -242,7 +286,6 @@
86f512
 	printpair_int(tcp, arg, "%u");
86f512
 	return RVAL_IOCTL_DECODED;
86f512
 }
86f512
-# endif /* EVIOCGREP || EVIOCSREP */
86f512
 
86f512
 static int
86f512
 bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
86f512
@@ -310,24 +353,18 @@
86f512
 		return RVAL_IOCTL_DECODED;
86f512
 	case EVIOCGID:
86f512
 		return getid_ioctl(tcp, arg);
86f512
-# ifdef EVIOCGREP
86f512
 	case EVIOCGREP:
86f512
 		return repeat_ioctl(tcp, arg);
86f512
-# endif
86f512
 	case EVIOCGKEYCODE:
86f512
 		return keycode_ioctl(tcp, arg);
86f512
-# ifdef EVIOCGKEYCODE_V2
86f512
 	case EVIOCGKEYCODE_V2:
86f512
 		return keycode_V2_ioctl(tcp, arg);
86f512
-# endif
86f512
 	}
86f512
 
86f512
 	/* fixed-number variable-length commands */
86f512
 	switch (_IOC_NR(code)) {
86f512
-# ifdef EVIOCGMTSLOTS
86f512
 	case _IOC_NR(EVIOCGMTSLOTS(0)):
86f512
 		return mtslots_ioctl(tcp, code, arg);
86f512
-# endif
86f512
 	case _IOC_NR(EVIOCGNAME(0)):
86f512
 	case _IOC_NR(EVIOCGPHYS(0)):
86f512
 	case _IOC_NR(EVIOCGUNIQ(0)):
86f512
@@ -337,20 +374,16 @@
86f512
 		else
86f512
 			printstrn(tcp, arg, tcp->u_rval);
86f512
 		return RVAL_IOCTL_DECODED;
86f512
-# ifdef EVIOCGPROP
86f512
 	case _IOC_NR(EVIOCGPROP(0)):
86f512
 		return decode_bitset(tcp, arg, evdev_prop,
86f512
 				     INPUT_PROP_MAX, "PROP_???",
86f512
 				     XT_INDEXED);
86f512
-# endif
86f512
 	case _IOC_NR(EVIOCGSND(0)):
86f512
 		return decode_bitset(tcp, arg, evdev_snd,
86f512
 				     SND_MAX, "SND_???", XT_INDEXED);
86f512
-# ifdef EVIOCGSW
86f512
 	case _IOC_NR(EVIOCGSW(0)):
86f512
 		return decode_bitset(tcp, arg, evdev_switch,
86f512
 				     SW_MAX, "SW_???", XT_INDEXED);
86f512
-# endif
86f512
 	case _IOC_NR(EVIOCGKEY(0)):
86f512
 		return decode_bitset(tcp, arg, evdev_keycode,
86f512
 				     KEY_MAX, "KEY_???", XT_INDEXED);
86f512
@@ -376,31 +409,23 @@
86f512
 {
86f512
 	/* fixed-number fixed-length commands */
86f512
 	switch (code) {
86f512
-# ifdef EVIOCSREP
86f512
 	case EVIOCSREP:
86f512
 		return repeat_ioctl(tcp, arg);
86f512
-# endif
86f512
 	case EVIOCSKEYCODE:
86f512
 		return keycode_ioctl(tcp, arg);
86f512
-# ifdef EVIOCSKEYCODE_V2
86f512
 	case EVIOCSKEYCODE_V2:
86f512
 		return keycode_V2_ioctl(tcp, arg);
86f512
-# endif
86f512
 	case EVIOCRMFF:
86f512
 		tprintf(", %d", (int) arg);
86f512
 		return RVAL_IOCTL_DECODED;
86f512
 	case EVIOCGRAB:
86f512
-# ifdef EVIOCREVOKE
86f512
 	case EVIOCREVOKE:
86f512
-# endif
86f512
 		tprintf(", %" PRI_klu, arg);
86f512
 		return RVAL_IOCTL_DECODED;
86f512
-# ifdef EVIOCSCLOCKID
86f512
 	case EVIOCSCLOCKID:
86f512
 		tprints(", ");
86f512
 		printnum_int(tcp, arg, "%u");
86f512
 		return RVAL_IOCTL_DECODED;
86f512
-# endif
86f512
 	}
86f512
 
86f512
 	int rc = evdev_write_ioctl_mpers(tcp, code, arg);
86f512
Index: strace-5.1/xlat/evdev_ioctl_cmds.in
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/evdev_ioctl_cmds.in	2020-01-29 12:37:35.139765850 +0100
86f512
@@ -0,0 +1,17 @@
86f512
+EVIOCGVERSION		_IOR('E', 0x01, int)
86f512
+EVIOCGID		_IOR('E', 0x02, struct input_id)
86f512
+EVIOCGREP		_IOR('E', 0x03, unsigned int[2])
86f512
+EVIOCSREP		_IOW('E', 0x03, unsigned int[2])
86f512
+EVIOCGKEYCODE		_IOR('E', 0x04, unsigned int[2])
86f512
+EVIOCGKEYCODE_V2	_IOR('E', 0x04, struct_input_keymap_entry)
86f512
+EVIOCSKEYCODE		_IOW('E', 0x04, unsigned int[2])
86f512
+EVIOCSKEYCODE_V2	_IOW('E', 0x04, struct_input_keymap_entry)
86f512
+/* struct ff_effect is personality-dependent in size */
86f512
+/* EVIOCSFF		_IOW('E', 0x80, struct ff_effect) */
86f512
+EVIOCRMFF		_IOW('E', 0x81, int)
86f512
+EVIOCGEFFECTS		_IOR('E', 0x84, int)
86f512
+EVIOCGRAB		_IOW('E', 0x90, int)
86f512
+EVIOCREVOKE		_IOW('E', 0x91, int)
86f512
+EVIOCGMASK		_IOR('E', 0x92, struct_input_mask)
86f512
+EVIOCSMASK		_IOW('E', 0x93, struct_input_mask)
86f512
+EVIOCSCLOCKID		_IOW('E', 0xa0, int)
86f512
Index: strace-5.1/xlat/evdev_ioctl_cmds.h
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/evdev_ioctl_cmds.h	2020-01-29 12:38:33.041234361 +0100
86f512
@@ -0,0 +1,144 @@
86f512
+/* Generated by ./xlat/gen.sh from ./xlat/evdev_ioctl_cmds.in; do not edit. */
86f512
+
86f512
+#include "gcc_compat.h"
86f512
+#include "static_assert.h"
86f512
+
86f512
+#if defined(EVIOCGVERSION) || (defined(HAVE_DECL_EVIOCGVERSION) && HAVE_DECL_EVIOCGVERSION)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGVERSION) == (_IOR('E', 0x01, int)), "EVIOCGVERSION != _IOR('E', 0x01, int)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGVERSION _IOR('E', 0x01, int)
86f512
+#endif
86f512
+#if defined(EVIOCGID) || (defined(HAVE_DECL_EVIOCGID) && HAVE_DECL_EVIOCGID)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGID) == (_IOR('E', 0x02, struct input_id)), "EVIOCGID != _IOR('E', 0x02, struct input_id)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGID _IOR('E', 0x02, struct input_id)
86f512
+#endif
86f512
+#if defined(EVIOCGREP) || (defined(HAVE_DECL_EVIOCGREP) && HAVE_DECL_EVIOCGREP)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGREP) == (_IOR('E', 0x03, unsigned int[2])), "EVIOCGREP != _IOR('E', 0x03, unsigned int[2])");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGREP _IOR('E', 0x03, unsigned int[2])
86f512
+#endif
86f512
+#if defined(EVIOCSREP) || (defined(HAVE_DECL_EVIOCSREP) && HAVE_DECL_EVIOCSREP)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCSREP) == (_IOW('E', 0x03, unsigned int[2])), "EVIOCSREP != _IOW('E', 0x03, unsigned int[2])");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCSREP _IOW('E', 0x03, unsigned int[2])
86f512
+#endif
86f512
+#if defined(EVIOCGKEYCODE) || (defined(HAVE_DECL_EVIOCGKEYCODE) && HAVE_DECL_EVIOCGKEYCODE)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGKEYCODE) == (_IOR('E', 0x04, unsigned int[2])), "EVIOCGKEYCODE != _IOR('E', 0x04, unsigned int[2])");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2])
86f512
+#endif
86f512
+#if defined(EVIOCGKEYCODE_V2) || (defined(HAVE_DECL_EVIOCGKEYCODE_V2) && HAVE_DECL_EVIOCGKEYCODE_V2)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGKEYCODE_V2) == (_IOR('E', 0x04, struct_input_keymap_entry)), "EVIOCGKEYCODE_V2 != _IOR('E', 0x04, struct_input_keymap_entry)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct_input_keymap_entry)
86f512
+#endif
86f512
+#if defined(EVIOCSKEYCODE) || (defined(HAVE_DECL_EVIOCSKEYCODE) && HAVE_DECL_EVIOCSKEYCODE)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCSKEYCODE) == (_IOW('E', 0x04, unsigned int[2])), "EVIOCSKEYCODE != _IOW('E', 0x04, unsigned int[2])");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2])
86f512
+#endif
86f512
+#if defined(EVIOCSKEYCODE_V2) || (defined(HAVE_DECL_EVIOCSKEYCODE_V2) && HAVE_DECL_EVIOCSKEYCODE_V2)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCSKEYCODE_V2) == (_IOW('E', 0x04, struct_input_keymap_entry)), "EVIOCSKEYCODE_V2 != _IOW('E', 0x04, struct_input_keymap_entry)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct_input_keymap_entry)
86f512
+#endif
86f512
+#if defined(EVIOCRMFF) || (defined(HAVE_DECL_EVIOCRMFF) && HAVE_DECL_EVIOCRMFF)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCRMFF) == (_IOW('E', 0x81, int)), "EVIOCRMFF != _IOW('E', 0x81, int)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCRMFF _IOW('E', 0x81, int)
86f512
+#endif
86f512
+#if defined(EVIOCGEFFECTS) || (defined(HAVE_DECL_EVIOCGEFFECTS) && HAVE_DECL_EVIOCGEFFECTS)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGEFFECTS) == (_IOR('E', 0x84, int)), "EVIOCGEFFECTS != _IOR('E', 0x84, int)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGEFFECTS _IOR('E', 0x84, int)
86f512
+#endif
86f512
+#if defined(EVIOCGRAB) || (defined(HAVE_DECL_EVIOCGRAB) && HAVE_DECL_EVIOCGRAB)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGRAB) == (_IOW('E', 0x90, int)), "EVIOCGRAB != _IOW('E', 0x90, int)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGRAB _IOW('E', 0x90, int)
86f512
+#endif
86f512
+#if defined(EVIOCREVOKE) || (defined(HAVE_DECL_EVIOCREVOKE) && HAVE_DECL_EVIOCREVOKE)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCREVOKE) == (_IOW('E', 0x91, int)), "EVIOCREVOKE != _IOW('E', 0x91, int)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCREVOKE _IOW('E', 0x91, int)
86f512
+#endif
86f512
+#if defined(EVIOCGMASK) || (defined(HAVE_DECL_EVIOCGMASK) && HAVE_DECL_EVIOCGMASK)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCGMASK) == (_IOR('E', 0x92, struct_input_mask)), "EVIOCGMASK != _IOR('E', 0x92, struct_input_mask)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCGMASK _IOR('E', 0x92, struct_input_mask)
86f512
+#endif
86f512
+#if defined(EVIOCSMASK) || (defined(HAVE_DECL_EVIOCSMASK) && HAVE_DECL_EVIOCSMASK)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCSMASK) == (_IOW('E', 0x93, struct_input_mask)), "EVIOCSMASK != _IOW('E', 0x93, struct_input_mask)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCSMASK _IOW('E', 0x93, struct_input_mask)
86f512
+#endif
86f512
+#if defined(EVIOCSCLOCKID) || (defined(HAVE_DECL_EVIOCSCLOCKID) && HAVE_DECL_EVIOCSCLOCKID)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((EVIOCSCLOCKID) == (_IOW('E', 0xa0, int)), "EVIOCSCLOCKID != _IOW('E', 0xa0, int)");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define EVIOCSCLOCKID _IOW('E', 0xa0, int)
86f512
+#endif
86f512
+
86f512
+#ifndef XLAT_MACROS_ONLY
86f512
+
86f512
+# ifdef IN_MPERS
86f512
+
86f512
+#  error static const struct xlat evdev_ioctl_cmds in mpers mode
86f512
+
86f512
+# else
86f512
+
86f512
+static
86f512
+const struct xlat evdev_ioctl_cmds[] = {
86f512
+ XLAT(EVIOCGVERSION),
86f512
+ XLAT(EVIOCGID),
86f512
+ XLAT(EVIOCGREP),
86f512
+ XLAT(EVIOCSREP),
86f512
+ XLAT(EVIOCGKEYCODE),
86f512
+ XLAT(EVIOCGKEYCODE_V2),
86f512
+ XLAT(EVIOCSKEYCODE),
86f512
+ XLAT(EVIOCSKEYCODE_V2),
86f512
+
86f512
+
86f512
+ XLAT(EVIOCRMFF),
86f512
+ XLAT(EVIOCGEFFECTS),
86f512
+ XLAT(EVIOCGRAB),
86f512
+ XLAT(EVIOCREVOKE),
86f512
+ XLAT(EVIOCGMASK),
86f512
+ XLAT(EVIOCSMASK),
86f512
+ XLAT(EVIOCSCLOCKID),
86f512
+ XLAT_END
86f512
+};
86f512
+
86f512
+# endif /* !IN_MPERS */
86f512
+
86f512
+#endif /* !XLAT_MACROS_ONLY */