summaryrefslogtreecommitdiffstats
path: root/drivers/input/input-mt.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-04-14 08:51:33 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-04-14 08:51:33 -0700
commit85a3685852d9ac7d92be9d824533c915a4597fa4 (patch)
treeb7c542e2061cf96c9f7ad500fa12567f9ff0b39f /drivers/input/input-mt.c
parent92bac83dd79e60e65c475222e41a992a70434beb (diff)
parent8b8a518ef16be2de27207991e32fc32b0475c767 (diff)
downloadop-kernel-dev-85a3685852d9ac7d92be9d824533c915a4597fa4.zip
op-kernel-dev-85a3685852d9ac7d92be9d824533c915a4597fa4.tar.gz
Merge branch 'next' into for-linus
Prepare first round of input updates for 4.1 merge window.
Diffstat (limited to 'drivers/input/input-mt.c')
-rw-r--r--drivers/input/input-mt.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index cb150a1..b097af2 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -365,27 +365,35 @@ static void input_mt_set_slots(struct input_mt *mt,
int *slots, int num_pos)
{
struct input_mt_slot *s;
- int *w = mt->red, *p;
+ int *w = mt->red, j;
- for (p = slots; p != slots + num_pos; p++)
- *p = -1;
+ for (j = 0; j != num_pos; j++)
+ slots[j] = -1;
for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
if (!input_mt_is_active(s))
continue;
- for (p = slots; p != slots + num_pos; p++)
- if (*w++ < 0)
- *p = s - mt->slots;
+
+ for (j = 0; j != num_pos; j++) {
+ if (w[j] < 0) {
+ slots[j] = s - mt->slots;
+ break;
+ }
+ }
+
+ w += num_pos;
}
for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
if (input_mt_is_active(s))
continue;
- for (p = slots; p != slots + num_pos; p++)
- if (*p < 0) {
- *p = s - mt->slots;
+
+ for (j = 0; j != num_pos; j++) {
+ if (slots[j] < 0) {
+ slots[j] = s - mt->slots;
break;
}
+ }
}
}
OpenPOWER on IntegriCloud