Commit 8c127f07 authored by Hans Petter Selasky's avatar Hans Petter Selasky Committed by Dmitry Torokhov

Input: properly assign return value of clamp() macro.

[dtor@mail.ru: added mousedev changes]
Signed-off-by: default avatarHans Petter Selasky <hselasky@c2i.net>
Cc: stable@kernel.org
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent b73077eb
...@@ -1756,7 +1756,7 @@ static unsigned int input_estimate_events_per_packet(struct input_dev *dev) ...@@ -1756,7 +1756,7 @@ static unsigned int input_estimate_events_per_packet(struct input_dev *dev)
} else if (test_bit(ABS_MT_TRACKING_ID, dev->absbit)) { } else if (test_bit(ABS_MT_TRACKING_ID, dev->absbit)) {
mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum - mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum -
dev->absinfo[ABS_MT_TRACKING_ID].minimum + 1, dev->absinfo[ABS_MT_TRACKING_ID].minimum + 1,
clamp(mt_slots, 2, 32); mt_slots = clamp(mt_slots, 2, 32);
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
mt_slots = 2; mt_slots = 2;
} else { } else {
......
...@@ -187,7 +187,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev, ...@@ -187,7 +187,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
if (size == 0) if (size == 0)
size = xres ? : 1; size = xres ? : 1;
clamp(value, min, max); value = clamp(value, min, max);
mousedev->packet.x = ((value - min) * xres) / size; mousedev->packet.x = ((value - min) * xres) / size;
mousedev->packet.abs_event = 1; mousedev->packet.abs_event = 1;
...@@ -201,7 +201,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev, ...@@ -201,7 +201,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
if (size == 0) if (size == 0)
size = yres ? : 1; size = yres ? : 1;
clamp(value, min, max); value = clamp(value, min, max);
mousedev->packet.y = yres - ((value - min) * yres) / size; mousedev->packet.y = yres - ((value - min) * yres) / size;
mousedev->packet.abs_event = 1; mousedev->packet.abs_event = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment