Skip to content

Commit

Permalink
Input: properly assign return value of clamp() macro.
Browse files Browse the repository at this point in the history
[dtor@mail.ru: added mousedev changes]
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Hans Petter Selasky authored and Dmitry Torokhov committed May 25, 2011
1 parent b73077e commit 8c127f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum -
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)) {
mt_slots = 2;
} else {
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/mousedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
if (size == 0)
size = xres ? : 1;

clamp(value, min, max);
value = clamp(value, min, max);

mousedev->packet.x = ((value - min) * xres) / size;
mousedev->packet.abs_event = 1;
Expand All @@ -201,7 +201,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
if (size == 0)
size = yres ? : 1;

clamp(value, min, max);
value = clamp(value, min, max);

mousedev->packet.y = yres - ((value - min) * yres) / size;
mousedev->packet.abs_event = 1;
Expand Down

0 comments on commit 8c127f0

Please sign in to comment.