Skip to contentSkip to conversation

Input: input.h: Fix EVIOCSFF macro inconsistency by using _IOW()

PATCH Applied Elias Vanderstuyft 2 participants 3 messages Sep 17, 2015 – Oct 15, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: input.h: Fix EVIOCSFF macro inconsistency by using _IOW()

Just like the EVIOCSABS(abs) macro, use the more compact _IOW(..., type) instead of _IOC(_IOC_WRITE, ..., sizeof(type)) for the EVIOCSFF macro.

---
 include/uapi/linux/input.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/input.h +1 -1
index 731417c..63915a7 100644
@@ -147,7 +147,7 @@ struct input_keymap_entry {
 #define EVIOCGABS(abs)		_IOR('E', 0x40 + (abs), struct input_absinfo)	/* get abs value/limits */
 #define EVIOCSABS(abs)		_IOW('E', 0xc0 + (abs), struct input_absinfo)	/* set abs value/limits */
 
-#define EVIOCSFF		_IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))	/* send a force effect to a force feedback device */
+#define EVIOCSFF		_IOW('E', 0x80, struct ff_effect)	/* send a force effect to a force feedback device */
 #define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */
 #define EVIOCGEFFECTS		_IOR('E', 0x84, int)			/* Report number of effects playable at the same time */
 
Signature · 1 line
1.9.3
#1 lore raw
Quoted 23 lines · Elias Vanderstuyft

Just like the EVIOCSABS(abs) macro, use the more compact _IOW(..., type) instead of _IOC(_IOC_WRITE, ..., sizeof(type)) for the EVIOCSFF macro.

---
 include/uapi/linux/input.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/input.h +1 -2
index 731417c..63915a7 100644
@@ -147,7 +147,7 @@ struct input_keymap_entry {
 #define EVIOCGABS(abs)         _IOR('E', 0x40 + (abs), struct input_absinfo)   /* get abs value/limits */
 #define EVIOCSABS(abs)         _IOW('E', 0xc0 + (abs), struct input_absinfo)   /* set abs value/limits */
 
-#define EVIOCSFF               _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))   /* send a force effect to a force feedback device */
+#define EVIOCSFF               _IOW('E', 0x80, struct ff_effect)       /* send a force effect to a force feedback device */
 #define EVIOCRMFF              _IOW('E', 0x81, int)                    /* Erase a force effect */
 #define EVIOCGEFFECTS          _IOR('E', 0x84, int)                    /* Report number of effects playable at the same time */
 
--
Quoted 2 lines

1.9.3

Hi Dmitry,

Is there anything that prevents this patch to be applied? About a year ago, we discussed this by message:
https://www.marc.info/?l=linux-input&m=141020112415578&w=1

Thanks,
Elias

maintainer Applied
#2 lore raw
In reply to Elias Vanderstuyft
Quoted 5 lines · Elias Vanderstuyft

Just like the EVIOCSABS(abs) macro, use the more compact _IOW(..., type) instead of _IOC(_IOC_WRITE, ..., sizeof(type)) for the EVIOCSFF macro.

Applied, thank you.

Quoted 20 lines
---
 include/uapi/linux/input.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/input.h +1 -1
index 731417c..63915a7 100644
@@ -147,7 +147,7 @@ struct input_keymap_entry {
 #define EVIOCGABS(abs)		_IOR('E', 0x40 + (abs), struct input_absinfo)	/* get abs value/limits */
 #define EVIOCSABS(abs)		_IOW('E', 0xc0 + (abs), struct input_absinfo)	/* set abs value/limits */
 
-#define EVIOCSFF		_IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))	/* send a force effect to a force feedback device */
+#define EVIOCSFF		_IOW('E', 0x80, struct ff_effect)	/* send a force effect to a force feedback device */
 #define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */
 #define EVIOCGEFFECTS		_IOR('E', 0x84, int)			/* Report number of effects playable at the same time */
 
Signature · 1 line
1.9.3
Signature · 1 line
Dmitry