diff options
| -rw-r--r-- | drivers/input/misc/uinput.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index b247e1c8e8f6..86328e9c9848 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
| @@ -40,7 +40,8 @@ | |||
| 40 | #include <linux/input/mt.h> | 40 | #include <linux/input/mt.h> |
| 41 | #include "../input-compat.h" | 41 | #include "../input-compat.h" |
| 42 | 42 | ||
| 43 | static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 43 | static int uinput_dev_event(struct input_dev *dev, |
| 44 | unsigned int type, unsigned int code, int value) | ||
| 44 | { | 45 | { |
| 45 | struct uinput_device *udev = input_get_drvdata(dev); | 46 | struct uinput_device *udev = input_get_drvdata(dev); |
| 46 | 47 | ||
| @@ -95,7 +96,8 @@ static int uinput_request_reserve_slot(struct uinput_device *udev, | |||
| 95 | uinput_request_alloc_id(udev, request)); | 96 | uinput_request_alloc_id(udev, request)); |
| 96 | } | 97 | } |
| 97 | 98 | ||
| 98 | static void uinput_request_done(struct uinput_device *udev, struct uinput_request *request) | 99 | static void uinput_request_done(struct uinput_device *udev, |
| 100 | struct uinput_request *request) | ||
| 99 | { | 101 | { |
| 100 | /* Mark slot as available */ | 102 | /* Mark slot as available */ |
| 101 | udev->requests[request->id] = NULL; | 103 | udev->requests[request->id] = NULL; |
| @@ -151,7 +153,7 @@ static int uinput_request_submit(struct uinput_device *udev, | |||
| 151 | } | 153 | } |
| 152 | 154 | ||
| 153 | /* | 155 | /* |
| 154 | * Fail all ouitstanding requests so handlers don't wait for the userspace | 156 | * Fail all outstanding requests so handlers don't wait for the userspace |
| 155 | * to finish processing them. | 157 | * to finish processing them. |
| 156 | */ | 158 | */ |
| 157 | static void uinput_flush_requests(struct uinput_device *udev) | 159 | static void uinput_flush_requests(struct uinput_device *udev) |
| @@ -187,7 +189,9 @@ static int uinput_dev_playback(struct input_dev *dev, int effect_id, int value) | |||
| 187 | return uinput_dev_event(dev, EV_FF, effect_id, value); | 189 | return uinput_dev_event(dev, EV_FF, effect_id, value); |
| 188 | } | 190 | } |
| 189 | 191 | ||
| 190 | static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *effect, struct ff_effect *old) | 192 | static int uinput_dev_upload_effect(struct input_dev *dev, |
| 193 | struct ff_effect *effect, | ||
| 194 | struct ff_effect *old) | ||
| 191 | { | 195 | { |
| 192 | struct uinput_device *udev = input_get_drvdata(dev); | 196 | struct uinput_device *udev = input_get_drvdata(dev); |
| 193 | struct uinput_request request; | 197 | struct uinput_request request; |
| @@ -353,7 +357,8 @@ static int uinput_allocate_device(struct uinput_device *udev) | |||
| 353 | return 0; | 357 | return 0; |
| 354 | } | 358 | } |
| 355 | 359 | ||
| 356 | static int uinput_setup_device(struct uinput_device *udev, const char __user *buffer, size_t count) | 360 | static int uinput_setup_device(struct uinput_device *udev, |
| 361 | const char __user *buffer, size_t count) | ||
| 357 | { | 362 | { |
| 358 | struct uinput_user_dev *user_dev; | 363 | struct uinput_user_dev *user_dev; |
| 359 | struct input_dev *dev; | 364 | struct input_dev *dev; |
| @@ -425,7 +430,8 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu | |||
| 425 | return retval; | 430 | return retval; |
| 426 | } | 431 | } |
| 427 | 432 | ||
| 428 | static inline ssize_t uinput_inject_event(struct uinput_device *udev, const char __user *buffer, size_t count) | 433 | static ssize_t uinput_inject_event(struct uinput_device *udev, |
| 434 | const char __user *buffer, size_t count) | ||
| 429 | { | 435 | { |
| 430 | struct input_event ev; | 436 | struct input_event ev; |
| 431 | 437 | ||
| @@ -440,7 +446,8 @@ static inline ssize_t uinput_inject_event(struct uinput_device *udev, const char | |||
| 440 | return input_event_size(); | 446 | return input_event_size(); |
| 441 | } | 447 | } |
| 442 | 448 | ||
| 443 | static ssize_t uinput_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) | 449 | static ssize_t uinput_write(struct file *file, const char __user *buffer, |
| 450 | size_t count, loff_t *ppos) | ||
| 444 | { | 451 | { |
| 445 | struct uinput_device *udev = file->private_data; | 452 | struct uinput_device *udev = file->private_data; |
| 446 | int retval; | 453 | int retval; |
| @@ -744,7 +751,8 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd, | |||
| 744 | break; | 751 | break; |
| 745 | 752 | ||
| 746 | req = uinput_request_find(udev, ff_up.request_id); | 753 | req = uinput_request_find(udev, ff_up.request_id); |
| 747 | if (!req || req->code != UI_FF_UPLOAD || !req->u.upload.effect) { | 754 | if (!req || req->code != UI_FF_UPLOAD || |
| 755 | !req->u.upload.effect) { | ||
| 748 | retval = -EINVAL; | 756 | retval = -EINVAL; |
| 749 | break; | 757 | break; |
| 750 | } | 758 | } |
| @@ -827,7 +835,8 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 827 | } | 835 | } |
| 828 | 836 | ||
| 829 | #ifdef CONFIG_COMPAT | 837 | #ifdef CONFIG_COMPAT |
| 830 | static long uinput_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 838 | static long uinput_compat_ioctl(struct file *file, |
| 839 | unsigned int cmd, unsigned long arg) | ||
| 831 | { | 840 | { |
| 832 | return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg)); | 841 | return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg)); |
| 833 | } | 842 | } |
| @@ -872,4 +881,3 @@ MODULE_VERSION("0.3"); | |||
| 872 | 881 | ||
| 873 | module_init(uinput_init); | 882 | module_init(uinput_init); |
| 874 | module_exit(uinput_exit); | 883 | module_exit(uinput_exit); |
| 875 | |||
