aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-02 23:38:13 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-02 23:38:13 -0800
commit467832032cc07626880363efa8625719c16c04eb (patch)
treeee9a62c04f0b3106e412bc1b2dd1cea5566d5ca7 /drivers/input/input.c
parentInput: keyboard - fix lack of locking when traversing handler->h_list (diff)
parentLinux 2.6.32 (diff)
downloadlinux-dev-467832032cc07626880363efa8625719c16c04eb.tar.xz
linux-dev-467832032cc07626880363efa8625719c16c04eb.zip
Merge commit 'v2.6.32' into next
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 5d6421bde4ba..5c16001959cc 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1292,17 +1292,24 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
return 0;
}
-#define INPUT_DO_TOGGLE(dev, type, bits, on) \
- do { \
- int i; \
- if (!test_bit(EV_##type, dev->evbit)) \
- break; \
- for (i = 0; i < type##_MAX; i++) { \
- if (!test_bit(i, dev->bits##bit) || \
- !test_bit(i, dev->bits)) \
- continue; \
- dev->event(dev, EV_##type, i, on); \
- } \
+#define INPUT_DO_TOGGLE(dev, type, bits, on) \
+ do { \
+ int i; \
+ bool active; \
+ \
+ if (!test_bit(EV_##type, dev->evbit)) \
+ break; \
+ \
+ for (i = 0; i < type##_MAX; i++) { \
+ if (!test_bit(i, dev->bits##bit)) \
+ continue; \
+ \
+ active = test_bit(i, dev->bits); \
+ if (!active && !on) \
+ continue; \
+ \
+ dev->event(dev, EV_##type, i, on ? active : 0); \
+ } \
} while (0)
#ifdef CONFIG_PM