aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/uinput.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-30 01:48:32 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-08-22 01:29:54 -0400
commitc5b3533a82ef4b6ceae81b7675f8d6dadcc6f3ab (patch)
tree00324d8ba4df6ea5cf97e6b775d7f0032eaa4b28 /include/linux/uinput.h
parent00ce756ce53acdb82d408346e6a7b734ca9e5bad (diff)
Input: uinput - specify exact bit sizes on userspace APIs
Switch to using __u32/__s32 instead of ordinary 'int' in structures forming userspace API. Also internally make request_id unsigned int. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include/linux/uinput.h')
-rw-r--r--include/linux/uinput.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 2aa2881b0df9..c454bbe39ee7 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -32,6 +32,7 @@
32 * - first public version 32 * - first public version
33 */ 33 */
34 34
35#include <linux/types.h>
35#include <linux/input.h> 36#include <linux/input.h>
36 37
37#define UINPUT_VERSION 3 38#define UINPUT_VERSION 3
@@ -44,14 +45,14 @@
44enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; 45enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED };
45 46
46struct uinput_request { 47struct uinput_request {
47 int id; 48 unsigned int id;
48 int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ 49 unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */
49 50
50 int retval; 51 int retval;
51 struct completion done; 52 struct completion done;
52 53
53 union { 54 union {
54 int effect_id; 55 unsigned int effect_id;
55 struct { 56 struct {
56 struct ff_effect *effect; 57 struct ff_effect *effect;
57 struct ff_effect *old; 58 struct ff_effect *old;
@@ -77,16 +78,16 @@ struct uinput_device {
77#endif /* __KERNEL__ */ 78#endif /* __KERNEL__ */
78 79
79struct uinput_ff_upload { 80struct uinput_ff_upload {
80 int request_id; 81 __u32 request_id;
81 int retval; 82 __s32 retval;
82 struct ff_effect effect; 83 struct ff_effect effect;
83 struct ff_effect old; 84 struct ff_effect old;
84}; 85};
85 86
86struct uinput_ff_erase { 87struct uinput_ff_erase {
87 int request_id; 88 __u32 request_id;
88 int retval; 89 __s32 retval;
89 int effect_id; 90 __u32 effect_id;
90}; 91};
91 92
92/* ioctl */ 93/* ioctl */
@@ -166,11 +167,11 @@ struct uinput_ff_erase {
166struct uinput_user_dev { 167struct uinput_user_dev {
167 char name[UINPUT_MAX_NAME_SIZE]; 168 char name[UINPUT_MAX_NAME_SIZE];
168 struct input_id id; 169 struct input_id id;
169 int ff_effects_max; 170 __u32 ff_effects_max;
170 int absmax[ABS_CNT]; 171 __s32 absmax[ABS_CNT];
171 int absmin[ABS_CNT]; 172 __s32 absmin[ABS_CNT];
172 int absfuzz[ABS_CNT]; 173 __s32 absfuzz[ABS_CNT];
173 int absflat[ABS_CNT]; 174 __s32 absflat[ABS_CNT];
174}; 175};
175#endif /* __UINPUT_H_ */ 176#endif /* __UINPUT_H_ */
176 177