]> git.baikalelectronics.ru Git - kernel.git/commit
Input: make input_report_slot_state() return boolean
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 5 Jun 2018 17:08:44 +0000 (10:08 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 11 Jun 2018 17:21:06 +0000 (10:21 -0700)
commitdb63fc7950749c6d55b1c1e027a742614b176079
treec125ed31db1afc366437d35a4c5bf1db6272dbbc
parent9572e1e46a6b3b80d1ab5983410036fabf2d623a
Input: make input_report_slot_state() return boolean

Let's make input_report_slot_state() return boolean representing whether
the contact is active or not. This will allow writing code like:

if (input_mt_report_slot_state(input, obj->mt_tool,
obj->type != RMI_2D_OBJECT_NONE) {

input_event(sensor->input, EV_ABS, ABS_MT_POSITION_X, obj->x);
input_event(sensor->input, EV_ABS, ABS_MT_POSITION_Y, obj->y);
...
}

instead of:

input_mt_report_slot_state(input, obj->mt_tool,
   obj->type != RMI_2D_OBJECT_NONE);
if (obj->type != RMI_2D_OBJECT_NONE) {
input_event(sensor->input, EV_ABS, ABS_MT_POSITION_X, obj->x);
input_event(sensor->input, EV_ABS, ABS_MT_POSITION_Y, obj->y);
...
}

Reviewed-by: Henrik Rydberg <rydberg@bitmath.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redaht.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input-mt.c
include/linux/input/mt.h