diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-07-30 01:48:32 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-08-22 01:29:54 -0400 |
commit | c5b3533a82ef4b6ceae81b7675f8d6dadcc6f3ab (patch) | |
tree | 00324d8ba4df6ea5cf97e6b775d7f0032eaa4b28 /drivers/input | |
parent | 00ce756ce53acdb82d408346e6a7b734ca9e5bad (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 'drivers/input')
-rw-r--r-- | drivers/input/misc/uinput.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 6099365102d..b247e1c8e8f 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 | |||
59 | static bool uinput_request_alloc_id(struct uinput_device *udev, | 59 | static 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 | ||
80 | static struct uinput_request *uinput_request_find(struct uinput_device *udev, int id) | 80 | static 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 |
558 | struct uinput_ff_upload_compat { | 559 | struct 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 | }; |