aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/misc/uinput.c11
-rw-r--r--include/linux/uinput.h27
2 files changed, 20 insertions, 18 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 6099365102db..b247e1c8e8f6 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -59,7 +59,7 @@ static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned i
59static bool uinput_request_alloc_id(struct uinput_device *udev, 59static bool uinput_request_alloc_id(struct uinput_device *udev,
60 struct uinput_request *request) 60 struct uinput_request *request)
61{ 61{
62 int id; 62 unsigned int id;
63 bool reserved = false; 63 bool reserved = false;
64 64
65 spin_lock(&udev->requests_lock); 65 spin_lock(&udev->requests_lock);
@@ -77,10 +77,11 @@ static bool uinput_request_alloc_id(struct uinput_device *udev,
77 return reserved; 77 return reserved;
78} 78}
79 79
80static struct uinput_request *uinput_request_find(struct uinput_device *udev, int id) 80static struct uinput_request *uinput_request_find(struct uinput_device *udev,
81 unsigned int id)
81{ 82{
82 /* Find an input request, by ID. Returns NULL if the ID isn't valid. */ 83 /* Find an input request, by ID. Returns NULL if the ID isn't valid. */
83 if (id >= UINPUT_NUM_REQUESTS || id < 0) 84 if (id >= UINPUT_NUM_REQUESTS)
84 return NULL; 85 return NULL;
85 86
86 return udev->requests[id]; 87 return udev->requests[id];
@@ -556,8 +557,8 @@ static int uinput_release(struct inode *inode, struct file *file)
556 557
557#ifdef CONFIG_COMPAT 558#ifdef CONFIG_COMPAT
558struct uinput_ff_upload_compat { 559struct uinput_ff_upload_compat {
559 int request_id; 560 __u32 request_id;
560 int retval; 561 __s32 retval;
561 struct ff_effect_compat effect; 562 struct ff_effect_compat effect;
562 struct ff_effect_compat old; 563 struct ff_effect_compat old;
563}; 564};
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