diff options
author | Dmitry Torokhov | 2010-07-15 23:27:36 -0700 |
---|---|---|
committer | Dmitry Torokhov | 2010-07-15 23:52:33 -0700 |
commit | 20da92de8ec3c1d4ba7e5aca322d38b6ce634932 (patch) | |
tree | 2349309cc452763e649c75f94bf00c327376f8d2 /drivers/input | |
parent | 72c8a94a585afea1f45aa8c4f6938ed6d05be57a (diff) |
Input: change input handlers to use bool when possible
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/evdev.c | 6 | ||||
-rw-r--r-- | drivers/input/input.c | 6 | ||||
-rw-r--r-- | drivers/input/joydev.c | 7 | ||||
-rw-r--r-- | drivers/input/mousedev.c | 6 |
4 files changed, 12 insertions, 13 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index fc5afbd78625..70c0eb52ca96 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -24,7 +24,6 @@ #include "input-compat.h" struct evdev { - int exist; int open; int minor; struct input_handle handle; @@ -34,6 +33,7 @@ struct evdev { spinlock_t client_lock; /* protects client_list */ struct mutex mutex; struct device dev; + bool exist; }; struct evdev_client { @@ -793,7 +793,7 @@ static void evdev_remove_chrdev(struct evdev *evdev) static void evdev_mark_dead(struct evdev *evdev) { mutex_lock(&evdev->mutex); - evdev->exist = 0; + evdev->exist = false; mutex_unlock(&evdev->mutex); } @@ -842,7 +842,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev, init_waitqueue_head(&evdev->wait); dev_set_name(&evdev->dev, "event%d", minor); - evdev->exist = 1; + evdev->exist = true; evdev->minor = minor; evdev->handle.dev = input_get_device(dev); diff --git a/drivers/input/input.c b/drivers/input/input.c index 54109c33e36c..e1243b4b32a5 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -227,12 +227,12 @@ static void input_handle_event(struct input_dev *dev, case SYN_REPORT: if (!dev->sync) { - dev->sync = 1; + dev->sync = true; disposition = INPUT_PASS_TO_HANDLERS; } break; case SYN_MT_REPORT: - dev->sync = 0; + dev->sync = false; disposition = INPUT_PASS_TO_HANDLERS; break; } @@ -317,7 +317,7 @@ static void input_handle_event(struct input_dev *dev, } if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - dev->sync = 0; + dev->sync = false; if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event) dev->event(dev, type, code, value); diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 34157bb97ed6..63834585c283 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -37,7 +37,6 @@ MODULE_LICENSE("GPL"); #define JOYDEV_BUFFER_SIZE 64 struct joydev { - int exist; int open; int minor; struct input_handle handle; @@ -46,6 +45,7 @@ struct joydev { spinlock_t client_lock; /* protects client_list */ struct mutex mutex; struct device dev; + bool exist; struct js_corr corr[ABS_CNT]; struct JS_DATA_SAVE_TYPE glue; @@ -760,7 +760,7 @@ static void joydev_remove_chrdev(struct joydev *joydev) static void joydev_mark_dead(struct joydev *joydev) { mutex_lock(&joydev->mutex); - joydev->exist = 0; + joydev->exist = false; mutex_unlock(&joydev->mutex); } @@ -817,10 +817,9 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev, init_waitqueue_head(&joydev->wait); dev_set_name(&joydev->dev, "js%d", minor); - joydev->exist = 1; + joydev->exist = true; joydev->minor = minor; - joydev->exist = 1; joydev->handle.dev = input_get_device(dev); joydev->handle.name = dev_name(&joydev->dev); joydev->handle.handler = handler; diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index f34b22bce4ff..d7a7a2fce745 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -57,7 +57,6 @@ struct mousedev_hw_data { }; struct mousedev { - int exist; int open; int minor; struct input_handle handle; @@ -66,6 +65,7 @@ struct mousedev { spinlock_t client_lock; /* protects client_list */ struct mutex mutex; struct device dev; + bool exist; struct list_head mixdev_node; int mixdev_open; @@ -802,7 +802,7 @@ static void mousedev_remove_chrdev(struct mousedev *mousedev) static void mousedev_mark_dead(struct mousedev *mousedev) { mutex_lock(&mousedev->mutex); - mousedev->exist = 0; + mousedev->exist = false; mutex_unlock(&mousedev->mutex); } @@ -862,7 +862,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev, dev_set_name(&mousedev->dev, "mouse%d", minor); mousedev->minor = minor; - mousedev->exist = 1; + mousedev->exist = true; mousedev->handle.dev = input_get_device(dev); mousedev->handle.name = dev_name(&mousedev->dev); mousedev->handle.handler = handler; |