diff options
| -rw-r--r-- | drivers/input/input.c | 2 | ||||
| -rw-r--r-- | include/linux/input/mt.h | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 1f78c957a75a..8921c6180c51 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -180,7 +180,7 @@ static int input_handle_abs_event(struct input_dev *dev, | |||
| 180 | return INPUT_IGNORE_EVENT; | 180 | return INPUT_IGNORE_EVENT; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | is_mt_event = code >= ABS_MT_FIRST && code <= ABS_MT_LAST; | 183 | is_mt_event = input_is_mt_value(code); |
| 184 | 184 | ||
| 185 | if (!is_mt_event) { | 185 | if (!is_mt_event) { |
| 186 | pold = &dev->absinfo[code].value; | 186 | pold = &dev->absinfo[code].value; |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index 318bb82325a6..f86737586e19 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
| @@ -48,10 +48,14 @@ static inline void input_mt_slot(struct input_dev *dev, int slot) | |||
| 48 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | 48 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | static inline bool input_is_mt_value(int axis) | ||
| 52 | { | ||
| 53 | return axis >= ABS_MT_FIRST && axis <= ABS_MT_LAST; | ||
| 54 | } | ||
| 55 | |||
| 51 | static inline bool input_is_mt_axis(int axis) | 56 | static inline bool input_is_mt_axis(int axis) |
| 52 | { | 57 | { |
| 53 | return axis == ABS_MT_SLOT || | 58 | return axis == ABS_MT_SLOT || input_is_mt_value(axis); |
| 54 | (axis >= ABS_MT_FIRST && axis <= ABS_MT_LAST); | ||
| 55 | } | 59 | } |
| 56 | 60 | ||
| 57 | void input_mt_report_slot_state(struct input_dev *dev, | 61 | void input_mt_report_slot_state(struct input_dev *dev, |
