Commit 8c127f0717b438e6abc3d92d4ae248c4224b9dcb
Committed by
Dmitry Torokhov
1 parent
b73077eb03
Exists in
master
and in
39 other branches
Input: properly assign return value of clamp() macro.
[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>
Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff
drivers/input/input.c
... | ... | @@ -1756,7 +1756,7 @@ |
1756 | 1756 | } else if (test_bit(ABS_MT_TRACKING_ID, dev->absbit)) { |
1757 | 1757 | mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum - |
1758 | 1758 | dev->absinfo[ABS_MT_TRACKING_ID].minimum + 1, |
1759 | - clamp(mt_slots, 2, 32); | |
1759 | + mt_slots = clamp(mt_slots, 2, 32); | |
1760 | 1760 | } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { |
1761 | 1761 | mt_slots = 2; |
1762 | 1762 | } else { |
drivers/input/mousedev.c
... | ... | @@ -187,7 +187,7 @@ |
187 | 187 | if (size == 0) |
188 | 188 | size = xres ? : 1; |
189 | 189 | |
190 | - clamp(value, min, max); | |
190 | + value = clamp(value, min, max); | |
191 | 191 | |
192 | 192 | mousedev->packet.x = ((value - min) * xres) / size; |
193 | 193 | mousedev->packet.abs_event = 1; |
... | ... | @@ -201,7 +201,7 @@ |
201 | 201 | if (size == 0) |
202 | 202 | size = yres ? : 1; |
203 | 203 | |
204 | - clamp(value, min, max); | |
204 | + value = clamp(value, min, max); | |
205 | 205 | |
206 | 206 | mousedev->packet.y = yres - ((value - min) * yres) / size; |
207 | 207 | mousedev->packet.abs_event = 1; |